Method CreateOneAsync
CreateOneAsync(IndexKeysDefinition<TDocument>, CreateIndexOptions, CancellationToken)
Creates an index.
[Obsolete("Use CreateOneAsync with a CreateIndexModel instead.")]
public virtual Task<string> CreateOneAsync(IndexKeysDefinition<TDocument> keys, CreateIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
keys
IndexKeys <TDocument>Definition The keys.
options
CreateIndex Options The create index request options.
cancellationToken
CancellationToken The cancellation token.
Returns
CreateOneAsync(CreateIndexModel<TDocument>, CreateOneIndexOptions, CancellationToken)
Creates an index.
public virtual Task<string> CreateOneAsync(CreateIndexModel<TDocument> model, CreateOneIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
model
CreateIndex <TDocument>Model The model defining the index.
options
CreateOne Index Options The create index operation options.
cancellationToken
CancellationToken The cancellation token.
Returns
CreateOneAsync(IClientSessionHandle, IndexKeysDefinition<TDocument>, CreateIndexOptions, CancellationToken)
Creates an index.
[Obsolete("Use CreateOneAsync with a CreateIndexModel instead.")]
public virtual Task<string> CreateOneAsync(IClientSessionHandle session, IndexKeysDefinition<TDocument> keys, CreateIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSession Handle The session.
keys
IndexKeys <TDocument>Definition The keys.
options
CreateIndex Options The create index request options.
cancellationToken
CancellationToken The cancellation token.
Returns
CreateOneAsync(IClientSessionHandle, CreateIndexModel<TDocument>, CreateOneIndexOptions, CancellationToken)
Creates an index.
public virtual Task<string> CreateOneAsync(IClientSessionHandle session, CreateIndexModel<TDocument> model, CreateOneIndexOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSession Handle The session.
model
CreateIndex <TDocument>Model The model defining the index.
options
CreateOne Index Options The create index operation options.
cancellationToken
CancellationToken The cancellation token.