Table of Contents

Method CreateOne

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

CreateOne(BsonDocument, string, CancellationToken)

Creates a search index.

string CreateOne(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

string

The name of the index that was created.

CreateOne(CreateSearchIndexModel, CancellationToken)

Creates a search index.

string CreateOne(CreateSearchIndexModel model, CancellationToken cancellationToken = default)

Parameters

model CreateSearchIndexModel

The model defining the index.

cancellationToken CancellationToken

The cancellation token.

Returns

string

The name of the index that was created.