Click or drag to resize

IMongoIndexManagerTDocumentCreateManyAsync Method (IClientSessionHandle, IEnumerableCreateIndexModelTDocument, CancellationToken)

Creates multiple indexes.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.20.0+ee01960089f28ea1b501690df5fc9f6318a70242
Syntax
Task<IEnumerable<string>> CreateManyAsync(
	IClientSessionHandle session,
	IEnumerable<CreateIndexModel<TDocument>> models,
	CancellationToken cancellationToken = null
)

Parameters

session
Type: MongoDB.DriverIClientSessionHandle
The session.
models
Type: System.Collections.GenericIEnumerableCreateIndexModelTDocument
The models defining each of the indexes.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: TaskIEnumerableString
A task whose result is an IEnumerableT of the names of the indexes that were created.
See Also