diff options
author | Aaron <aaron@10gen.com> | 2009-05-22 10:46:33 -0400 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-05-22 10:46:33 -0400 |
commit | d8e129c8ab3844903cd19ae565ab32faf0aadd59 (patch) | |
tree | 676d7d70b53a0a1957f1fc0a03bd955e4b54be5b /dbtests | |
parent | 80502a3fdb0ea4127b1b04a468bbe23dbb1484aa (diff) | |
download | mongo-d8e129c8ab3844903cd19ae565ab32faf0aadd59.tar.gz |
BUG SERVER-67 correctly handle insertion of new null element with $set
Diffstat (limited to 'dbtests')
-rw-r--r-- | dbtests/updatetests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dbtests/updatetests.cpp b/dbtests/updatetests.cpp index 6c50b3b39d4..10beba793c0 100644 --- a/dbtests/updatetests.cpp +++ b/dbtests/updatetests.cpp @@ -456,6 +456,15 @@ namespace UpdateTests { } }; + class UpdateMissingToNull : public SetBase { + public: + void run() { + client().insert( ns(), BSON( "a" << 5 ) ); + client().update( ns(), BSON( "a" << 5 ), fromjson( "{$set:{b:null}}" ) ); + ASSERT_EQUALS( jstNULL, client().findOne( ns(), QUERY( "a" << 5 ) ).getField( "b" ).type() ); + } + }; + class All : public Suite { public: All() { @@ -503,6 +512,7 @@ namespace UpdateTests { add< ModParentOfIndex >(); add< PreserveIdWithIndex >(); add< CheckNoMods >(); + add< UpdateMissingToNull >(); } }; |