mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
15 lines
366 B
JavaScript
15 lines
366 B
JavaScript
|
|
||
|
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() );
|
||
|
|