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

Add the ability to specify a pipeline to the findAndModify command

    • Fully Compatible
    • Query 2019-04-08, Query 2019-04-22, Query 2019-05-06
    • 0

      The new syntax will look like this:

      {
        findAndModify: <collection-name>,
        query: <document>,
        sort: <document>,
        remove: <boolean>,
        update: <document OR pipeline>,
        new: <boolean>,
        fields: <document>,
        upsert: <boolean>,
        bypassDocumentValidation: <boolean>,
        writeConcern: <document>,
        collation: <document>,
        arrayFilters: <array>
      }
      

      The only supported stages in a pipeline will be single-document transformations: $addFields, $project, and $replaceRoot. For this ticket, we will not support options such as collation, bypassDocumentValidation, upsert, sort, and fields. Those options will be tracked by separate work items. We will never support arrayFilters in the pipeline-style update.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: