-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.6.0
-
Component/s: Write Ops
-
None
-
ALL
-
Quint 9 09/18/15
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When attempting to query on one field of an array element, the docs make it very clear that $elemMatch is not necessary.
For example, find({"list.field":"value"}) should match the following document: { "list":[ {"field":"value"}, {"otherField":"otherValue"} ] }.
However, doing an upsert using findAndModify on an empty collection:
findAndModify(
{"list.field":"value"},
{"$push":{"list":{"field":"value"}}},
{"upsert":1}
)
causes the following error:
"list" must be an array but is of type Object in document {INVALID-MUTABLE-ELEMENT}
- related to
-
SERVER-34973 Upsert querying an array, then pushing to this array with simple values
-
- Closed
-
-
SERVER-6566 Support conditional updates: $updates
-
- Closed
-