A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
A map of aliases for constructor args. Keys are the attribute names, e.g. "foo". Values are the alias that will replace the key in serialization. This is used to eg. make argument names match Python.
A map of additional attributes to merge with constructor args. Keys are the attribute names, e.g. "foo". Values are the attribute values, which will be serialized. These attributes need to be accepted by the constructor as arguments.
The final serialized identifier for the module.
A map of secrets, which will be omitted from serialization. Keys are paths to the secret in constructor args, e.g. "foo.bar.baz". Values are the secret ids, which will be used when deserializing.
Method that adds documents to the MongoDB collection. It first converts
the documents into vectors using the embedDocuments
method of the
embeddings
instance, and then adds these vectors to the collection.
Array of Document instances to be added to the MongoDB collection.
Promise that resolves when the documents have been added to the collection.
Method that adds vectors to the MongoDB collection. It creates an array of items, each containing the content, embedding, and metadata of a document, and then inserts these items into the collection.
Array of vectors to be added to the MongoDB collection.
Array of Document instances corresponding to the vectors.
Promise that resolves when the vectors have been added to the collection.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<MongoVectorStore>>Optional
filter: MongoVectorStoreQueryExtensionOptional
callbacks: CallbacksOptional
tags: string[]Optional
metadata: Record<string, unknown>Optional
verbose: booleanMethod that performs a similarity search on vectors and returns the documents and their similarity scores. It constructs a MongoDB aggregation pipeline, applies any post-query pipeline steps if provided, and then executes the pipeline to retrieve the results.
Query vector for the similarity search.
Number of nearest neighbors to return.
Optional
filter: MongoVectorStoreQueryExtensionOptional filter for the query, which can include post-query pipeline steps.
Promise that resolves to an array of tuples, each containing a Document instance and its similarity score.
Optional
maxReturn documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.
Text to look up documents similar to.
Static
fromStatic method that creates a MongoVectorStore
instance from an array
of Document instances. It creates a new MongoVectorStore
instance,
adds the documents to it, and then returns the instance.
Array of Document instances to be added to the MongoVectorStore
.
Embeddings instance used to convert the documents into vectors.
Configuration for the MongoDB database.
Promise that resolves to a new MongoVectorStore instance.
Static
fromStatic method that creates a MongoVectorStore
instance from an array
of texts. It creates Document instances from the texts and their
corresponding metadata, and then calls the fromDocuments
method to
create the MongoVectorStore
instance.
Array of texts to be converted into Document instances.
Array or single object of metadata corresponding to the texts.
Embeddings instance used to convert the texts into vectors.
Configuration for the MongoDB database.
Promise that resolves to a new MongoVectorStore instance.
Static
lc_Generated using TypeDoc
Deprecated
use
MongoDBAtlasVectorSearch
instead.