Click or drag to resize

IMongoIndexManager<TDocument>.CreateMany Method (IEnumerable<CreateIndexModel<TDocument>>, CancellationToken)

Creates multiple indexes.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.16.0+eeafbea0921243a5868b81984e1083a07c1f75bc
Syntax
IEnumerable<string> CreateMany(
	IEnumerable<CreateIndexModel<TDocument>> models,
	CancellationToken cancellationToken = default
)

Parameters

models
Type: System.Collections.Generic.IEnumerable<CreateIndexModel<TDocument>>
The models defining each of the indexes.
cancellationToken (Optional)
Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: IEnumerable<String>
An IEnumerable<T> of the names of the indexes that were created.
See Also