Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
ALL
-
Description
Original summary
$unset with positional $ fails to find nested field
Original Description
In a database with documents with a list of nested documents $unset does not match all elements in that list as expected.
A query like this
db.entities.update({}, {'$unset': {'status_history.$._types': true}}, {'multi': true})
|
...although the mongo manual at https://docs.mongodb.com/manual/reference/operator/update/positional/#unsets states "When used with the $unset operator, the positional $ operator does not remove the matching element from the array but rather sets it to null." which sounds like a flaw, not a desirable feature, but that's a different issue.