diff --git a/back/app/core/routes.py b/back/app/core/routes.py index 3987ef3d..ade3a804 100644 --- a/back/app/core/routes.py +++ b/back/app/core/routes.py @@ -1,4 +1,5 @@ from beanie import PydanticObjectId +from beanie.odm.operators.find.comparison import In from beanie.operators import And, RegEx, Eq from fastapi import APIRouter, HTTPException, Depends @@ -43,11 +44,13 @@ def parse_query(query: str, model): elif operator == 'eq': operand = Eq(column, value) + elif operator == 'in': + operand = In(column, value.split(',')) and_array.append(operand) if and_array: - return And(and_array) if len(and_array) > 1 else and_array[0] + return And(*and_array) if len(and_array) > 1 else and_array[0] else: return {}