@@ -683,9 +683,16 @@ The server's response to `bulkWrite` has the following format:
683
683
}
684
684
```
685
685
686
- If any operations were successful (i.e. ` nErrors ` is less than the number of operations that were sent), drivers MUST
687
- record the summary count fields in a ` BulkWriteResult ` to be returned to the user or embedded in a ` BulkWriteException ` .
688
- Drivers MUST NOT populate the ` partialResult ` field in ` BulkWriteException ` if no operations were successful.
686
+ Drivers MUST record the summary count fields in a ` BulkWriteResult ` to be returned to the user or embedded in a
687
+ ` BulkWriteException ` if the response indicates that at least one write was successful:
688
+
689
+ - For ordered bulk writes, at least one write was successful if ` nErrors ` is 0 or if the ` idx ` value for the write error
690
+ returned in the results cursor is greater than 0.
691
+ - For unordered bulk writes, at least one write was successful if ` nErrors ` is less than the number of operations that
692
+ were included in the ` bulkWrite ` command.
693
+
694
+ Drivers MUST NOT populate the ` partialResult ` field in ` BulkWriteException ` if it cannot be determined that at least one
695
+ write was successfully performed.
689
696
690
697
Drivers MUST attempt to consume the contents of the cursor returned in the server's ` bulkWrite ` response before
691
698
returning to the user. This is required regardless of whether the user requested verbose or summary results, as the
@@ -859,6 +866,8 @@ batch-splitting to standardize implementations across drivers and simplify batch
859
866
860
867
## ** Changelog**
861
868
869
+ - 2024-09-25: Update the ` partialResult ` population logic to account for ordered bulk writes.
870
+
862
871
- 2024-09-18: Relax numeric type requirements for indexes.
863
872
864
873
- 2024-05-17: Update specification status to "Accepted".
0 commit comments