Method that performs a similarity search on the vectors stored in the MongoDB collection. It returns a list of documents and their corresponding similarity scores.
similaritySearchVectorWithScore(
query: number[],
k: number,
filter: MongoDBAtlasFilter
): Promise<[Document<Record<string, any>>, number][]>| Name | Type | Description |
|---|---|---|
query* | number[] | Query vector for the similarity search. |
k* | number | Number of nearest neighbors to return. |
filter | MongoDBAtlasFilter | Optional filter to be applied. |