Skip to content

Commit

Permalink
fix: remove filters from MongoDBAtlasDocumentStore.count() method (#…
Browse files Browse the repository at this point in the history
…430)

* fix count

* empty dict

* lint
  • Loading branch information
ZanSara authored Feb 16, 2024
1 parent eeecd3c commit 91ad862
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ def from_dict(cls, data: Dict[str, Any]) -> "MongoDBAtlasDocumentStore":
deserialize_secrets_inplace(data["init_parameters"], keys=["mongo_connection_string"])
return default_from_dict(cls, data)

def count_documents(self, filters: Optional[Dict[str, Any]] = None) -> int:
def count_documents(self) -> int:
"""
Returns how many documents are present in the document store.
:param filters: The filters to apply. It counts only the documents that match the filters.
"""
return self.collection.count_documents(filters or {})
return self.collection.count_documents({})

def filter_documents(self, filters: Optional[Dict[str, Any]] = None) -> List[Document]:
"""
Expand Down

0 comments on commit 91ad862

Please sign in to comment.