diff --git a/firestore/google/cloud/firestore_v1beta1/query.py b/firestore/google/cloud/firestore_v1beta1/query.py index 2710e2e97026..14794da0103e 100644 --- a/firestore/google/cloud/firestore_v1beta1/query.py +++ b/firestore/google/cloud/firestore_v1beta1/query.py @@ -39,6 +39,7 @@ _EQ_OP: enums.StructuredQuery.FieldFilter.Operator.EQUAL, '>=': enums.StructuredQuery.FieldFilter.Operator.GREATER_THAN_OR_EQUAL, '>': enums.StructuredQuery.FieldFilter.Operator.GREATER_THAN, + 'array_contains': enums.StructuredQuery.FieldFilter.Operator.ARRAY_CONTAINS, } _BAD_OP_STRING = 'Operator string {!r} is invalid. Valid choices are: {}.' _BAD_OP_NAN_NULL = ( diff --git a/firestore/tests/unit/test_query.py b/firestore/tests/unit/test_query.py index 98d3f7b4fdd8..7979a79bf2b1 100644 --- a/firestore/tests/unit/test_query.py +++ b/firestore/tests/unit/test_query.py @@ -965,6 +965,7 @@ def test_success(self): self.assertEqual(self._call_fut('=='), op_class.EQUAL) self.assertEqual(self._call_fut('>='), op_class.GREATER_THAN_OR_EQUAL) self.assertEqual(self._call_fut('>'), op_class.GREATER_THAN) + self.assertEqual(self._call_fut('array_contains'), op_class.ARRAY_CONTAINS) def test_failure(self): with self.assertRaises(ValueError):