0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/update_addToSet2.js

12 lines
239 B
JavaScript
Raw Normal View History

2010-04-13 23:28:39 +02:00
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() );