Details
-
Task
-
Status: Open
-
Major - P3
-
Resolution: Unresolved
-
None
-
None
-
None
-
0.1
-
true
Description
Description
As of DOCS-3276, https://docs.mongodb.com/manual/reference/operator/update/positional/ provides instructions for matching multiple fields within an array for a positional update, using elemMatch.
However, given the caveats with matching multiple fields (SERVER-14662), I think "the positional $ operator acts as a placeholder for the first element that matches the query document" language is leading to confusion.
Would it be possible to reference something like "Update Embedded Documents Using a Single Field Match" in the Definition or Behavior section, as a prompt to direct readers to the "Update Embedded Documents Using Multiple Field Matches" section at the end of the page?
By way of example, this is explicit in the "$ (projection)" documentation at https://docs.mongodb.com/manual/reference/operator/projection/positional/#array-field-limitations, with the following language: "The query document should only contain a single condition on the array field being projected. Multiple conditions may override each other internally and lead to undefined behavior."
Thank you in advance!
Scope of changes
- Update and backport as needed
Attachments
Issue Links
- is related to
-
DOCS-3276 Positional Update with multiple elements
-
- Closed
-
-
SERVER-14662 Positional projection queries (and positional update ops) should fail with error if multiple arrays encountered
-
- Closed
-