Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2476

New $update atomic modifier for changing array elements

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Write Ops
    • Labels:
      None
    • Environment:
      All
    • Backwards Compatibility:
      Fully Compatible

      Description

      The proposal: new $update atomic modifier to identify objects in an array using a query criteria and update them. I've tried to keep the syntax of this as close to update() as possible.

      $update:

      {field:[query, update, <upsert> ,<multi>]}

      In the update the following special tokens can be used:
      $$ the array denoted by "field", defining the scope of the operation.
      $ the current element identified by the query.

      This may or may not duplicate some of the virtual collections ticket: http://jira.mongodb.org/browse/SERVER-142 but that ticket doesn't really contain any more than an idea that clearly a lot of people like. I'm hoping that this ticket can start a discussion that can end up in a useful specification. Some examples to follow....

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                10 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: