asRetriever(
kOrFields: number | Partial<VectorStoreRetrieverInput<MongoDBAtlasVectorSearch>>,
filter: MongoDBAtlasFilter| Name | Type | Description |
|---|---|---|
kOrFields | number | Partial<VectorStoreRetrieverInput<MongoDBAtlasVectorSearch>> | If a number is provided, it sets the
|
filter | MongoDBAtlasFilter | Optional filter criteria to limit the items retrieved based on the specified filter type. |
callbacks | Callbacks | Optional callbacks that may be triggered at specific stages of the retrieval process. |
tags | string[] | |
metadata | Record<string, unknown> | |
verbose | boolean |
Basic usage with a `k` value:
const retriever = myVectorStore.asRetriever(5);Creates a VectorStoreRetriever instance with flexible configuration options.
Tags to categorize or label the VectorStoreRetriever. Defaults to an empty array if not provided.
Additional metadata as key-value pairs to add contextual information for the retrieval process.
If true, enables detailed logging for the retrieval process. Defaults to false.