Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Works as Designed
-
2.6.3
-
None
-
None
-
ALL
Description
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
Attachments
Issue Links
- duplicates
-
SERVER-3946 Update with $addToSet/$push with a query on same field is broken during insert
-
- Closed
-