Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12773

Explicitly refer to "Single Field Matches" for positional "$ (update)" operator

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
      None

      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

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              eric.sedor Eric Sedor
              Participants:
              Last commenter:
              Ravind Kumar Ravind Kumar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Days since reply:
                2 years, 27 weeks, 1 day ago