Click or drag to resize

MongoQueryableVectorSearchTSource, TField Method (IMongoQueryableTSource, FieldDefinitionTSource, QueryVector, Int32, VectorSearchOptionsTSource)

Appends a $vectorSearch stage to the LINQ pipeline.

Namespace:  MongoDB.Driver.Linq
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax
public static IMongoQueryable<TSource> VectorSearch<TSource, TField>(
	this IMongoQueryable<TSource> source,
	FieldDefinition<TSource> field,
	QueryVector queryVector,
	int limit,
	VectorSearchOptions<TSource> options = null
)

Parameters

source
Type: MongoDB.Driver.LinqIMongoQueryableTSource
A sequence of values.
field
Type: MongoDB.DriverFieldDefinitionTSource
The field.
queryVector
Type: MongoDB.DriverQueryVector
The query vector.
limit
Type: SystemInt32
The limit.
options (Optional)
Type: MongoDB.DriverVectorSearchOptionsTSource
The options.

Type Parameters

TSource
The type of the elements of source.
TField
The type of the field.

Return Value

Type: IMongoQueryableTSource
The queryable with a new stage appended.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IMongoQueryableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also