Click or drag to resize

IMongoIndexManagerTDocumentCreateOne Method (IndexKeysDefinitionTDocument, CreateIndexOptions, CancellationToken)

Note: This API is now obsolete.

Creates an index.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.17.0+b316340e6cc3a8bfc8638dc31b54fbbfe41bfcb2
[ObsoleteAttribute("Use CreateOne with a CreateIndexModel instead.")]
string CreateOne(
	IndexKeysDefinition<TDocument> keys,
	CreateIndexOptions options = null,
	CancellationToken cancellationToken = default


Type: MongoDB.DriverIndexKeysDefinitionTDocument
The keys.
options (Optional)
Type: MongoDB.DriverCreateIndexOptions
The create index request options.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
The cancellation token.

Return Value

Type: String
The name of the index that was created.
See Also