add delete where command

This commit is contained in:
Matteo Rosati
2026-04-21 21:26:40 +02:00
parent bd08c2bda3
commit 1132af238a
4 changed files with 82 additions and 3 deletions
+7
View File
@@ -44,6 +44,13 @@ def delete_collection(name: str) -> None:
client.delete_collection(name=name)
def delete_data(collection_name: str, where: dict[str, str]) -> int:
_, collection = _get_client_and_collection(collection_name)
result = collection.delete(where=where)
return int(result.get("deleted", 0))
def count_collection(collection_name: str) -> int:
_, collection = _get_client_and_collection(collection_name)