Method CreateOne
CreateOne(IndexKeysDefinition<TDocument>, CreateIndexOptions, CancellationToken)
Creates an index.
[Obsolete("Use CreateOne with a CreateIndexModel instead.")]
public virtual 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(CreateIndexModel<TDocument>, CreateOneIndexOptions, CancellationToken)
Creates an index.
public virtual 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(IClientSessionHandle, IndexKeysDefinition<TDocument>, CreateIndexOptions, CancellationToken)
Creates an index.
[Obsolete("Use CreateOne with a CreateIndexModel instead.")]
public virtual 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.
public virtual 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.