From f8a9cda27e159099868d6c9cc90bef6f66258d5a Mon Sep 17 00:00:00 2001 From: Logan Date: Mon, 27 Apr 2026 00:54:35 -0400 Subject: [PATCH] update firestore to FieldFilter --- drb-c2-core/app/internal/firestore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drb-c2-core/app/internal/firestore.py b/drb-c2-core/app/internal/firestore.py index 7279b11..302811f 100644 --- a/drb-c2-core/app/internal/firestore.py +++ b/drb-c2-core/app/internal/firestore.py @@ -2,6 +2,7 @@ import asyncio from typing import Optional, Any import firebase_admin from firebase_admin import credentials, firestore as fs +from google.cloud.firestore_v1.base_query import FieldFilter from app.config import settings from app.internal.logger import logger @@ -51,7 +52,7 @@ async def collection_list(collection: str, **filters) -> list[dict]: def _query(): ref = db.collection(collection) for field, value in filters.items(): - ref = ref.where(field, "==", value) + ref = ref.where(filter=FieldFilter(field, "==", value)) return [doc.to_dict() for doc in ref.stream()] return await asyncio.to_thread(_query) @@ -69,7 +70,7 @@ async def collection_where( def _query(): ref = db.collection(collection) for field, op, value in conditions: - ref = ref.where(field, op, value) + ref = ref.where(filter=FieldFilter(field, op, value)) return [doc.to_dict() for doc in ref.stream()] return await asyncio.to_thread(_query)