This looks like unusual behavior.
For example with a document like:
{ "_id" : ObjectId("4fd2736696a0c5567029c674"), "x" : 10 }Issuing an update with $pullAll on a key that does not exist inside an embedded doc causes the field to be created:
db.test.update(
{x:10}, {$pullAll : {"test.a" : ["foo", "bar"]}})
The (empty) embedded object "test" will now exist in the doc:
> db.test.find()
{ "_id" : ObjectId("4fd2736696a0c5567029c674"), "test" : { }, "x" : 10 }
I would have expected no change in the document's fields if the $pullAll references a key that does not exist.
- is depended on by
-
JAVA-827 Support SASL PLAIN authentication
- Closed
- is related to
-
SERVER-6124 $unset may create a nested field if it doesn't exist
- Closed