Table of Contents

Method BulkWrite

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

BulkWrite(IEnumerable<WriteModel<TDocument>>, BulkWriteOptions, CancellationToken)

Performs multiple write operations.

BulkWriteResult<TDocument> BulkWrite(IEnumerable<WriteModel<TDocument>> requests, BulkWriteOptions options = null, CancellationToken cancellationToken = default)

Parameters

requests IEnumerable<WriteModel<TDocument>>

The requests.

options BulkWriteOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

BulkWriteResult<TDocument>

The result of writing.

BulkWrite(IClientSessionHandle, IEnumerable<WriteModel<TDocument>>, BulkWriteOptions, CancellationToken)

Performs multiple write operations.

BulkWriteResult<TDocument> BulkWrite(IClientSessionHandle session, IEnumerable<WriteModel<TDocument>> requests, BulkWriteOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

requests IEnumerable<WriteModel<TDocument>>

The requests.

options BulkWriteOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

BulkWriteResult<TDocument>

The result of writing.