Table of Contents

Method VectorSearch

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

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<TInput>

The options.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.

TField

The type of the field.

VectorSearch<TInput>(FieldDefinition<TInput>, QueryVector, int, VectorSearchOptions<TInput>)

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<TInput>

The field.

queryVector QueryVector

The query vector.

limit int

The limit.

options VectorSearchOptions<TInput>

The options.

Returns

PipelineStageDefinition<TInput, TInput>

The stage.

Type Parameters

TInput

The type of the input documents.