0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/update_addToSet2.js
Eliot Horowitz e70082b29e another test
2010-04-13 17:28:39 -04:00

12 lines
239 B
JavaScript

t = db.update_addToSet2
t.drop();
o = { _id : 1 }
t.insert( { _id : 1 } );
t.update({},{$addToSet : {'kids' :{ 'name' : 'Bob', 'age': '4'}}})
t.update({},{$addToSet : {'kids' :{ 'name' : 'Dan', 'age': '2'}}})
printjson( t.findOne() );