diff options
Diffstat (limited to 'jstests/core/set5.js')
-rw-r--r-- | jstests/core/set5.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jstests/core/set5.js b/jstests/core/set5.js new file mode 100644 index 00000000000..afa0d014bde --- /dev/null +++ b/jstests/core/set5.js @@ -0,0 +1,17 @@ + +t = db.set5; +t.drop(); + +function check( want , err ){ + var x = t.findOne(); + delete x._id; + assert.docEq( 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" ) |