0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/set5.js
2010-02-10 13:35:43 -05:00

18 lines
346 B
JavaScript

t = db.set5;
t.drop();
function check( want , err ){
var x = t.findOne();
delete x._id;
assert.eq( want , x , err );
}
t.update( { a : 5 } , { $set : { a : 6 , b : null } } , true );
check( { a : 6 , b : null } , "A" )
t.drop();
t.update( { z : 5 } , { $set : { z : 6 , b : null } } , true );
check( { b : null , z : 6 } , "B" )