summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-05-22 10:46:33 -0400
committerAaron <aaron@10gen.com>2009-05-22 10:46:33 -0400
commitd8e129c8ab3844903cd19ae565ab32faf0aadd59 (patch)
tree676d7d70b53a0a1957f1fc0a03bd955e4b54be5b /dbtests
parent80502a3fdb0ea4127b1b04a468bbe23dbb1484aa (diff)
downloadmongo-d8e129c8ab3844903cd19ae565ab32faf0aadd59.tar.gz
BUG SERVER-67 correctly handle insertion of new null element with $set
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/updatetests.cpp10
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 >();
}
};