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
This commit is contained in:
Paul-Emile Brotons 2023-06-06 23:22:23 +02:00 committed by GitHub
parent b177a29d3f
commit daf3e99b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)