Table of Contents

Method BulkWriteAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Performs multiple write operations.

Task<BulkWriteResult<TDocument>> BulkWriteAsync(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

Task<BulkWriteResult<TDocument>>

The result of writing.

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

Performs multiple write operations.

Task<BulkWriteResult<TDocument>> BulkWriteAsync(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

Task<BulkWriteResult<TDocument>>

The result of writing.