[SERVER-80293] Add more summary fields to bulkWrite response Created: 21/Aug/23  Updated: 10/Nov/23  Resolved: 09/Nov/23

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

Type: Task Priority: Major - P3
Reporter: Sean Zimmerman 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
is related to SERVER-83138 nMatched in bulkWrite response should... Closed
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-11-13
Participants:

 Description   

See https://mongodb.slack.com/archives/C035ZJL6CQN/p1692638285661919 for more context

We originally added numErrors as a summary field so the driver wouldn't have to iterate the cursor to see if any errors occurred. We want to provide the same for them for nInserted, nMatched, nModified, nUpserted, nDeleted so the driver can choose to not request a cursor (batchSize 0) and only return summary fields as an API option

This ticket is to support these fields on both mongod and mongos

This should also change numErorrs to nErrors for consistency with the new fields

As part of this we should add singleBatch as an option to the bulkWrite command which will act the same as for other cursor commands (like find) where we only return the firstBatch and do not save the remaining results in a cursor to be fetched later



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

Author:

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

Message: SERVER-80293: Add summary fields to bulkWrite
Branch: master
https://github.com/mongodb/mongo/commit/d160de127ae3e1b1ab363bd15bcb6afe6c1ca8fc

Comment by Lingzhi Deng [ 06/Sep/23 ]

Currently for cursor commands, a batchSize of 0 means that the cursor will be established, but no documents will be returned in the first batch. So I am not sure if we still want to make (batchSize 0) behave differently for bulkWrite.

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