diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2013-12-05 14:21:57 -0500 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2013-12-09 17:31:11 -0500 |
commit | 32311b5f0e7a6d00cc2253d7f21397b51f0e126b (patch) | |
tree | e6f9747128cd041bcf33a5bd71fadef7bf6d7e48 | |
parent | 2a0b5f2e171db7e6fac39b94794d9c0e0b3a5ff0 (diff) | |
download | mongo-32311b5f0e7a6d00cc2253d7f21397b51f0e126b.tar.gz |
SERVER-6124: $unset may create a nested field if it doesn't exist
-rw-r--r-- | jstests/update3.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/jstests/update3.js b/jstests/update3.js index 264172a5c26..995c6e67b45 100644 --- a/jstests/update3.js +++ b/jstests/update3.js @@ -20,4 +20,9 @@ assert.eq( 5, f.findOne().a.b , "C" ); f.drop(); f.save( {'_id':0} ); f.update( {}, {$set:{'_id':5}} ); -assert.eq( 0, f.findOne()._id , "D" );
\ No newline at end of file +assert.eq( 0, f.findOne()._id , "D" ); + +f.drop(); +f.save({_id:1, a:1}) +f.update({}, {$unset:{"a":1, "b.c":1}}) +assert.docEq(f.findOne(), {_id:1}, "E")
\ No newline at end of file |