-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.3
-
Component/s: Querying
-
None
-
ALL
With an empty collection, run this:
db.Food.update( { "names" : { "$all" : [ "corn"]}}, { "$addToSet" : { "names" : "corn"}}, { upsert: true });
Results in this error:
Cannot apply $addToSet to a non-array field. Field named 'names' has a non-array type String in the document INVALID-MUTABLE-ELEMENT
Tested in 2.6.3
It worked fine in 2.4.10
- duplicates
-
SERVER-3946 Update with $addToSet/$push with a query on same field is broken during insert
- Closed