Skip to content

Commit 5f8d6bb

Browse files
committed
re added doc existence check
1 parent 74f1d69 commit 5f8d6bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

filexdb/collection.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,4 +369,12 @@ def _find_document_by_query(self, query: Mapping) -> JsonArray[Document]:
369369

370370
return JsonArray(result)
371371

372+
def _doc_is_exists(self, doc_id: str) -> bool:
373+
# Iterate over all Documents of Collection
374+
for doc in self._collection:
375+
if doc["_id_"] == doc_id:
376+
return True
377+
378+
return False
379+
372380

0 commit comments

Comments
 (0)