Method CreateOne
CreateOne(CreateIndexModel<TDocument>, CreateOneIndexOptions, CancellationToken)
Creates an index.
string CreateOne(CreateIndexModel<TDocument> model, CreateOneIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
modelCreateIndexModel<TDocument>The model defining the index.
optionsCreateOneIndexOptionsThe create index operation options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- string
The name of the index that was created.
CreateOne(IndexKeysDefinition<TDocument>, CreateIndexOptions, CancellationToken)
Creates an index.
[Obsolete("Use CreateOne with a CreateIndexModel instead.")]
string CreateOne(IndexKeysDefinition<TDocument> keys, CreateIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
keysIndexKeysDefinition<TDocument>The keys.
optionsCreateIndexOptionsThe create index request options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- string
The name of the index that was created.
CreateOne(IClientSessionHandle, IndexKeysDefinition<TDocument>, CreateIndexOptions, CancellationToken)
Creates an index.
[Obsolete("Use CreateOne with a CreateIndexModel instead.")]
string CreateOne(IClientSessionHandle session, IndexKeysDefinition<TDocument> keys, CreateIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
sessionIClientSessionHandleThe session.
keysIndexKeysDefinition<TDocument>The keys.
optionsCreateIndexOptionsThe create index request options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- string
The name of the index that was created.
CreateOne(IClientSessionHandle, CreateIndexModel<TDocument>, CreateOneIndexOptions, CancellationToken)
Creates an index.
string CreateOne(IClientSessionHandle session, CreateIndexModel<TDocument> model, CreateOneIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
sessionIClientSessionHandleThe session.
modelCreateIndexModel<TDocument>The model defining the index.
optionsCreateOneIndexOptionsThe create index operation options.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- string
The name of the index that was created.