fromDocuments(
docs: Document<Record<string, any>>[],
embeddings: EmbeddingsInterface,
| Name | Type | Description |
|---|---|---|
docs* | Document<Record<string, any>>[] | List of documents to be converted to vectors. |
embeddings* | EmbeddingsInterface | |
dbConfig* | MongoDBAtlasVectorSearchLibArgs & __type |
Static method to create an instance of MongoDBAtlasVectorSearch from a list of documents. It first converts the documents to vectors and then adds them to the MongoDB collection.
Supports three calling conventions for backward compatibility:
fromDocuments(docs, embeddings, dbConfig) embeddings are provided by the userfromDocuments(docs, dbConfig) the server handles embeddingsDatabase configuration for MongoDB Atlas.