From 061516700aa8460ced34b31ab66d0aa1bc199bd0 Mon Sep 17 00:00:00 2001 From: Isabel Atkinson Date: Wed, 18 Sep 2024 16:06:56 -0400 Subject: [PATCH] DRIVERS-2968 Relax index type requirements in bulk write spec (#1661) --- source/crud/bulk-write.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/crud/bulk-write.md b/source/crud/bulk-write.md index 8090a979d..6e279f4fa 100644 --- a/source/crud/bulk-write.md +++ b/source/crud/bulk-write.md @@ -353,17 +353,17 @@ class BulkWriteResult { /** * The results of each individual insert operation that was successfully performed. */ - insertResults: Map; + insertResults: Map; /** * The results of each individual update operation that was successfully performed. */ - updateResults: Map; + updateResults: Map; /** * The results of each individual delete operation that was successfully performed. */ - deleteResults: Map; + deleteResults: Map; } class InsertOneResult { @@ -451,7 +451,7 @@ class BulkWriteException { * Errors that occurred during the execution of individual write operations. This map will * contain at most one entry if the bulk write was ordered. */ - writeErrors: Map; + writeErrors: Map; /** * The results of any successful operations that were performed before the error was @@ -461,6 +461,13 @@ class BulkWriteException { } ``` +### Index Types + +The `insertResults`, `updateResults`, and `deleteResults` maps in `BulkWriteResult` and the `writeErrors` map in +`BulkWriteException` specify `Index` as their key type. This value corresponds to the index of the operation in the +`writeModels` list that was provided to `MongoClient.bulkWrite`. Drivers SHOULD use their language's standard numeric +type for indexes for this type (e.g. `usize` in Rust). If no standard index type exists, drivers MUST use `Int64`. + ## Building a `bulkWrite` Command The `bulkWrite` server command has the following format: @@ -852,6 +859,8 @@ batch-splitting to standardize implementations across drivers and simplify batch ## **Changelog** +- 2024-09-18: Relax numeric type requirements for indexes. + - 2024-05-17: Update specification status to "Accepted". - 2024-05-10: Improve rendered format for JSON-like code blocks.