[SERVER-83138] nMatched in bulkWrite response should not count upserted documents Created: 10/Nov/23  Updated: 29/Nov/23  Resolved: 29/Nov/23

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

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

Issue Links:
Related
related to SERVER-80293 Add more summary fields to bulkWrite ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2023-12-11
Participants:

 Description   

In SERVER-80293 we added a top-level nMatched field for the bulkWrite command response. Currently this just sums the n value across all individual updates. However, that leads to us also counting upserted documents toward nMatched, because n is 1 for an upsert. We should fix this so that nMatched only counts non-upserts.



 Comments   
Comment by Githook User [ 29/Nov/23 ]

Author:

{'name': 'seanzimm', 'email': 'sean.zimmerman@mongodb.com', 'username': 'seanzimm'}

Message: SERVER-83138: Fix nMatched in bulkWrite
Branch: master
https://github.com/mongodb/mongo/commit/0760f954e190275a77a12b0f6ed8317824301bc5

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