Skip to content

Commit 44d33e3

Browse files
committed
fixed
1 parent 3625af1 commit 44d33e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

filexdb/collection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ def find(self, query=None, limit=None) -> List[Document]:
153153
if not isinstance(query, Mapping | None):
154154
raise ValueError('Document is not a Dictionary')
155155

156+
# Make sure the query implements the ``Mapping`` interface.
157+
if not isinstance(limit, tuple | None):
158+
raise ValueError('Document is not a Tuple')
159+
156160
# if limit, Check everything ok
157161
_limit_start = _limit_end = None
158162

@@ -371,7 +375,7 @@ def _find_document_by_query(self, query: Mapping) -> List:
371375
return result
372376

373377
# ======================== #
374-
def _doc_is_exists(self, doc_id: str | int) -> bool:
378+
def _doc_is_exists(self, doc_id: str) -> bool:
375379
# Iterate over all Documents of Collection
376380
for doc in self._collection:
377381
if doc["_id_"] == doc_id:

0 commit comments

Comments
 (0)