OrderedBulkWrite
| Default Value | Data Type | Required |
|---|---|---|
|
|
String |
No |
Description
This option specifies whether the connector executes write options one-by-one, or all at once.
True: The write operations are executed one-by-one in MongoDB in the order specified. If one of the write operations fails, MongoDB stops processing the remaining write operations in the batch, and the connector returns an error.False: The write operations are executed in parallel in MongoDB. If one of the write operations fails, MongoDB continues to execute the remaining write operations in the batch, but the connector still returns an error.
Note:
INSERT and UPSERT operations on virtual tables are always executed one-by-one, even when this property is set to False.
Important:
When executeBatch() fails, and OrderedBulkWrite is set to true, with WriteConcern not set to 0, the connector throws a BatchUpdateException and the update count for the failed and subsequent operations in the batch will all be set to -3. This is because in ordered bulk writes, MongoDB stops processing remaining operations after the failed operation.
When executeBatch() fails, and OrderedBulkWrite is set to false, with WriteConcern not set to 0, the connector throws a BatchUpdateException and the update count for only the failed batch will be set to -3 . This is because in unordered bulk writes, MongoDB does not stop processing the remaining operations after the failed operation.
Related topics
- JSONColumnSize
- General Driver Configuration Options
- Building the Connection URL