Table of Contents

Method CreateManyAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

CreateManyAsync(IEnumerable<CreateIndexModel<TDocument>>, CancellationToken)

Creates multiple indexes.

public virtual Task<IEnumerable<string>> CreateManyAsync(IEnumerable<CreateIndexModel<TDocument>> models, CancellationToken cancellationToken = default)

Parameters

models IEnumerable<CreateIndexModel<TDocument>>

The models defining each of the indexes.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<string>>

A task whose result is an IEnumerable<T> of the names of the indexes that were created.

CreateManyAsync(IEnumerable<CreateIndexModel<TDocument>>, CreateManyIndexesOptions, CancellationToken)

Creates multiple indexes.

public virtual Task<IEnumerable<string>> CreateManyAsync(IEnumerable<CreateIndexModel<TDocument>> models, CreateManyIndexesOptions options, CancellationToken cancellationToken = default)

Parameters

models IEnumerable<CreateIndexModel<TDocument>>

The models defining each of the indexes.

options CreateManyIndexesOptions

The options for create multiple indexes.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<string>>

A task whose result is an IEnumerable<T> of the names of the indexes that were created.

CreateManyAsync(IClientSessionHandle, IEnumerable<CreateIndexModel<TDocument>>, CancellationToken)

Creates multiple indexes.

public virtual Task<IEnumerable<string>> CreateManyAsync(IClientSessionHandle session, IEnumerable<CreateIndexModel<TDocument>> models, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

models IEnumerable<CreateIndexModel<TDocument>>

The models defining each of the indexes.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<string>>

A task whose result is an IEnumerable<T> of the names of the indexes that were created.

CreateManyAsync(IClientSessionHandle, IEnumerable<CreateIndexModel<TDocument>>, CreateManyIndexesOptions, CancellationToken)

Creates multiple indexes.

public virtual Task<IEnumerable<string>> CreateManyAsync(IClientSessionHandle session, IEnumerable<CreateIndexModel<TDocument>> models, CreateManyIndexesOptions options, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

models IEnumerable<CreateIndexModel<TDocument>>

The models defining each of the indexes.

options CreateManyIndexesOptions

The options for create multiple indexes.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IEnumerable<string>>

A task whose result is an IEnumerable<T> of the names of the indexes that were created.