Table of Contents

Method InsertManyAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

InsertManyAsync(IEnumerable<TDocument>, InsertManyOptions, CancellationToken)

Inserts many documents.

public virtual Task InsertManyAsync(IEnumerable<TDocument> documents, InsertManyOptions options = null, CancellationToken cancellationToken = default)

Parameters

documents IEnumerable<TDocument>

The documents.

options InsertManyOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

The result of the insert operation.

InsertManyAsync(IClientSessionHandle, IEnumerable<TDocument>, InsertManyOptions, CancellationToken)

Inserts many documents.

public virtual Task InsertManyAsync(IClientSessionHandle session, IEnumerable<TDocument> documents, InsertManyOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

documents IEnumerable<TDocument>

The documents.

options InsertManyOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

The result of the insert operation.