Table of Contents

Method CreateOneAsync

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

CreateOneAsync(BsonDocument, string, CancellationToken)

Creates a search index.

Task<string> CreateOneAsync(BsonDocument definition, string name = null, CancellationToken cancellationToken = default)

Parameters

definition BsonDocument

The index definition.

name string

The index name.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

The name of the index that was created.

CreateOneAsync(CreateSearchIndexModel, CancellationToken)

Creates a search index.

Task<string> CreateOneAsync(CreateSearchIndexModel model, CancellationToken cancellationToken = default)

Parameters

model CreateSearchIndexModel

The model defining the index.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

A Task whose result is the name of the index that was created.