Method CreateOne
CreateOne(CreateIndexModel<TDocument>, CreateOneIndexOptions, CancellationToken)
Creates an index.
string CreateOne(CreateIndexModel<TDocument> model, CreateOneIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
model
CreateIndexModel<TDocument>The model defining the index.
options
CreateOneIndexOptionsThe create index operation options.
cancellationToken
CancellationTokenThe 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
keys
IndexKeysDefinition<TDocument>The keys.
options
CreateIndexOptionsThe create index request options.
cancellationToken
CancellationTokenThe 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
session
IClientSessionHandleThe session.
keys
IndexKeysDefinition<TDocument>The keys.
options
CreateIndexOptionsThe create index request options.
cancellationToken
CancellationTokenThe 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
session
IClientSessionHandleThe session.
model
CreateIndexModel<TDocument>The model defining the index.
options
CreateOneIndexOptionsThe create index operation options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- string
The name of the index that was created.