Table of Contents

Method CreateMany

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Creates multiple indexes.

IEnumerable<string> CreateMany(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

IEnumerable<string>

An IEnumerable<T> of the names of the indexes that were created.

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

Creates multiple indexes.

IEnumerable<string> CreateMany(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

IEnumerable<string>

An IEnumerable<T> of the names of the indexes that were created.

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

Creates multiple indexes.

IEnumerable<string> CreateMany(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

IEnumerable<string>

An IEnumerable<T> of the names of the indexes that were created.

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

Creates multiple indexes.

IEnumerable<string> CreateMany(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

IEnumerable<string>

An IEnumerable<T> of the names of the indexes that were created.