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

BulkWriteReplyItem should only expose upsertedId rather than using write_ops::Upserted

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • Fully Compatible
    • Repl 2023-09-04

      Right now BulkWriteReplyItem uses the write_ops::Upserted type to expose information about upserts. 

      However, the Upserted type stores both an index as well as an _id. This makes sense in the context of the update command, since the Upserted type there is a top-level field on the command response and users need a way to map the upsert info back to the input operations. 

      But in bulkWrite, we are returning this info in the per-statement responses, so it is redundant to include the index. We should just expose the upsertedId instead. 

            Assignee:
            frederic.vitzikam@mongodb.com Frederic Vitzikam (Inactive)
            Reporter:
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: