0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/updatec.js

15 lines
366 B
JavaScript
Raw Normal View History

2010-01-26 05:48:52 +01:00
t = db.updatec;
t.drop();
t.update( { "_id" : 123 }, { $set : { "v" : { "i" : 123, "a":456 } }, $push : { "f" : 234} }, 1, 0 );
t.update( { "_id" : 123 }, { $set : { "v" : { "i" : 123, "a":456 } }, $push : { "f" : 234} }, 1, 0 );
assert.eq(
{
"_id" : 123,
"f" : [ 234, 234 ] ,
"v" : { "i" : 123, "a" : 456 }
} , t.findOne() );