diff --git a/chromadb/api/types.py b/chromadb/api/types.py index 7ea2a130aee..80e90ab5b40 100644 --- a/chromadb/api/types.py +++ b/chromadb/api/types.py @@ -594,8 +594,8 @@ def validate_where(where: Where) -> None: """ if not isinstance(where, dict): raise ValueError(f"Expected where to be a dict, got {where}") - if len(where) != 1: - raise ValueError(f"Expected where to have exactly one operator, got {where}") + if len(where) > 1: + raise ValueError(f"Expected where to have at most one operator, got {where}") for key, value in where.items(): if not isinstance(key, str): raise ValueError(f"Expected where key to be a str, got {key}") diff --git a/chromadb/segment/impl/metadata/grpc_segment.py b/chromadb/segment/impl/metadata/grpc_segment.py index 53ffdc72734..b7b22237cb9 100644 --- a/chromadb/segment/impl/metadata/grpc_segment.py +++ b/chromadb/segment/impl/metadata/grpc_segment.py @@ -142,9 +142,9 @@ def _where_to_proto(self, where: Optional[Where]) -> pb.Where: response = pb.Where() if where is None: return response - if len(where) != 1: + if len(where) > 1: raise ValueError( - f"Expected where to have exactly one operator, got {where}" + f"Expected where to have at most one operator, got {where}" ) for key, value in where.items():