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