bulkWrite

abstract suspend fun bulkWrite(requests: List<WriteModel<out TDocument>>): BulkWriteResult

Executes a mix of inserts, updates, replaces, and deletes.

Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. The eligibility for retryable write support for bulk operations is determined on the whole bulk write. If the requests contain any UpdateManyModels or DeleteManyModels then the bulk operation will not support retryable writes.

Parameters

requests

the writes to execute


abstract suspend fun bulkWrite(requests: List<WriteModel<out TDocument>>, options: BulkWriteOptions): BulkWriteResult

Executes a mix of inserts, updates, replaces, and deletes.

Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. The eligibility for retryable write support for bulk operations is determined on the whole bulk write. If the requests contain any UpdateManyModels or DeleteManyModels then the bulk operation will not support retryable writes.

Parameters

requests

the writes to execute

options

the options to apply to the bulk write operation


abstract suspend fun bulkWrite(clientSession: ClientSession, requests: List<WriteModel<out TDocument>>): BulkWriteResult

Executes a mix of inserts, updates, replaces, and deletes.

Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. The eligibility for retryable write support for bulk operations is determined on the whole bulk write. If the requests contain any UpdateManyModels or DeleteManyModels then the bulk operation will not support retryable writes.

Since

3.6

Parameters

clientSession

the client session with which to associate this operation

requests

the writes to execute


abstract suspend fun bulkWrite(    clientSession: ClientSession,     requests: List<WriteModel<out TDocument>>,     options: BulkWriteOptions): BulkWriteResult

Executes a mix of inserts, updates, replaces, and deletes.

Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled. The eligibility for retryable write support for bulk operations is determined on the whole bulk write. If the requests contain any UpdateManyModels or DeleteManyModels then the bulk operation will not support retryable writes.

Since

3.6

Parameters

clientSession

the client session with which to associate this operation

requests

the writes to execute

options

the options to apply to the bulk write operation