Skip to content
Snippets Groups Projects
Unverified Commit 3bdcfa6e authored by Ashish Bhatia's avatar Ashish Bhatia Committed by GitHub
Browse files

Improve efficiency of MongoDB reader (#12664)

......@@ -78,7 +78,11 @@ class SimpleMongoReader(BaseReader):
"""
db = self.client[db_name]
cursor = db[collection_name].find(filter=query_dict or {}, limit=max_docs)
cursor = db[collection_name].find(
filter=query_dict or {},
limit=max_docs,
projection={name: 1 for name in field_names + (metadata_names or [])},
)
for item in cursor:
try:
......
......@@ -28,7 +28,7 @@ license = "MIT"
maintainers = ["jerryjliu"]
name = "llama-index-readers-mongodb"
readme = "README.md"
version = "0.1.3"
version = "0.1.4"
[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment