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

findAndModify for multiple documents

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None

      Currently findAndModify operates over a single document. It would be a great improvement in funcionality if findAndModify operation had a flag to indicate the operation over multiple documents.

      Whenever I need to implement a simple processing queue or similar use cases, I catch myself wishing findAndModify could operate over a multiple documents!

      The current document parameter could have two additional two fields:
      multi: <boolean>
      limit: <number>

      To call findAndModify multiple times is expensive, so work arounds must be created like the example described by Remon van Vliet in http://stackoverflow.com/questions/16334045/solution-to-bulk-findandmodify-in-mongodb

      Regards!

            Assignee:
            Unassigned Unassigned
            Reporter:
            khalidsalomao Khalid Salomão
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: