Skip to content

Commit

Permalink
Add support for 'array_contains' query operator. (#6481)
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanTalip authored and tseaver committed Nov 13, 2018
1 parent 7668530 commit ce2a5fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions firestore/google/cloud/firestore_v1beta1/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
1 change: 1 addition & 0 deletions firestore/tests/unit/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit ce2a5fe

Please sign in to comment.