Method VectorSearch

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

VectorSearch<TInput, TField>(Expression<Func<TInput, TField>>, QueryVector, int, VectorSearchOptions)

Creates a $vectorSearch stage.

public static PipelineStageDefinition<TInput, TInput> VectorSearch<TInput, TField>(Expression<Func<TInput, TField>> field, QueryVector queryVector, int limit, VectorSearchOptions<TInput> options)

Parameters

field Expression<Func<TInput, TField>>

The field.

queryVector QueryVector

The query vector.

limit int

The limit.

options VectorSearchOptions

The options.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.

TField

The type of the field.

VectorSearch(FieldDefinition, QueryVector, int, VectorSearchOptions)

Creates a $vectorSearch stage.

public static PipelineStageDefinition<TInput, TInput> VectorSearch<TInput>(FieldDefinition<TInput> field, QueryVector queryVector, int limit, VectorSearchOptions<TInput> options = null)

Parameters

field FieldDefinition

The field.

queryVector QueryVector

The query vector.

limit int

The limit.

options VectorSearchOptions

The options.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.