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

Add updated/deleted _id's to response object of updateMany and deleteMany

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.6.0, 3.6.1, 3.6.2
    • Component/s: Querying
    • None
    • Query 2018-02-12

      When running the following code (in Node.js):

      collection.updateMany({type: "a"},{"$set":{b: "c"}}, cb)
      

      the response object does not show me which records have been updated.
      It only tells me the matchedCount and modifiedCount.

      Could you please add an array named something like: "modifiedIds" containing all _id's of the records that have been updated.
      This way you do not require two seperate calls to mongodb to update multiple records and get their _id's.

      Please also see my stackoverflow question for aditional information and the example.
      https://stackoverflow.com/questions/43743931/is-it-possible-to-get-all-the-ids-of-updated-records-in-mongodb-using-updatema

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            dexter.esajas Dexter Esajas
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: