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

New $update atomic modifier for changing array elements

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • Write Ops
    • None
    • All
    • 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

              backlog-server-query Backlog - Query Team (Inactive)
              keithbranton Keith Branton
              Votes:
              10 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: