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