[SERVER-79533] BulkWriteReplyItem should only expose upsertedId rather than using write_ops::Upserted Created: 31/Jul/23  Updated: 29/Oct/23  Resolved: 29/Aug/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Kaitlin Mahar Assignee: Frederic Vitzikam
Resolution: Fixed Votes: 0
Labels: milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-09-04
Participants:

 Description   

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. 



 Comments   
Comment by Githook User [ 25/Aug/23 ]

Author:

{'name': 'Frederic Vitzikam', 'email': 'frederic.vitzikam@mongodb.com', 'username': 'fredvitz'}

Message: SERVER-79533 BulkWriteReplyItem should only expose upsertedId rather than using write_ops::Upserted
Branch: master
https://github.com/mongodb/mongo/commit/6f66cec16c75987e371d4656d6ef79b1edbb801e

Generated at Thu Feb 08 06:41:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.