From daf3e99b9623e28e9fba2ce7704d7a647ca062bb Mon Sep 17 00:00:00 2001 From: Paul-Emile Brotons <38215315+P-E-B@users.noreply.github.com> Date: Tue, 6 Jun 2023 23:22:23 +0200 Subject: [PATCH] fixing from_documents method of the MongoDB Atlas vector store (#5794) FIxed a bug in from_documents method --> Collection objects do not implement truth value testing or bool(). @dev2049 --- langchain/vectorstores/mongodb_atlas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langchain/vectorstores/mongodb_atlas.py b/langchain/vectorstores/mongodb_atlas.py index 78df5317..7a16a6e0 100644 --- a/langchain/vectorstores/mongodb_atlas.py +++ b/langchain/vectorstores/mongodb_atlas.py @@ -262,7 +262,7 @@ class MongoDBAtlasVectorSearch(VectorStore): collection=collection ) """ - if not collection: + if collection is None: raise ValueError("Must provide 'collection' named parameter.") vecstore = cls(collection, embedding, **kwargs) vecstore.add_texts(texts, metadatas=metadatas)