fix(mongodb): wrap list() return in outer list to match interface contract (#5729)

This commit is contained in:
Hrushikesh Yadav
2026-06-22 11:54:16 +05:30
committed by GitHub
parent 513b56159f
commit ce0531a13e
2 changed files with 19 additions and 15 deletions
+2 -2
View File
@@ -382,10 +382,10 @@ class MongoDB(VectorStoreBase):
cursor = self.collection.find(query).limit(top_k)
results = [OutputData(id=str(doc["_id"]), score=None, payload=doc.get("payload")) for doc in cursor]
logger.info(f"Retrieved {len(results)} documents from collection '{self.collection_name}'.")
return results
return [results]
except PyMongoError as e:
logger.error(f"Error listing documents: {e}")
return []
return [[]]
def reset(self):
"""Reset the index by deleting and recreating it."""