The following works as expected (notice the shared stem "foo" is 1 level deep):
> db["partial_test"].save({foo: {bar: 20}})
> db["partial_test"].save({foo: {baz: 30}})
> db["partial_test"].find({},
)
{"_id" : ObjectId( "4ab26302c030ee7ea3cec844") , "foo" : {"bar" : 20}}
{"_id" : ObjectId( "4ab26308c030ee7ea3cec845") , "foo" : {"baz" : 30}}
However. if the shared stem is 2 levels deep ("foo.bar") the returned results are wonky:
> db["partial_test"].save({foo: {bar:
}})
> db["partial_test"].save({foo: {bar:
}})
> db["partial_test"].find({},
)
{"_id" : ObjectId( "4ab2733fc030ee7ea3cec847") , "foo" : {"bar" :
, "bar" :
{"baz1" : 20}}}
{"_id" : ObjectId( "4ab27341c030ee7ea3cec848") , "foo" : {"bar" : {} , "bar" : {}}}