summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Hernandez <scotthernandez@gmail.com>2013-12-05 14:21:57 -0500
committerScott Hernandez <scotthernandez@gmail.com>2013-12-09 17:31:11 -0500
commit32311b5f0e7a6d00cc2253d7f21397b51f0e126b (patch)
treee6f9747128cd041bcf33a5bd71fadef7bf6d7e48
parent2a0b5f2e171db7e6fac39b94794d9c0e0b3a5ff0 (diff)
downloadmongo-32311b5f0e7a6d00cc2253d7f21397b51f0e126b.tar.gz
SERVER-6124: $unset may create a nested field if it doesn't exist
-rw-r--r--jstests/update3.js7
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