google-cloud-firestore 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12a9c7f721487eef84a1d703f77f0b2f56aea624fc9c6e1052be059c49437a6f
4
- data.tar.gz: 76d354bb9933a7a83ef6163fef5bd37da82808786f05d06a83f54dc605ca1154
3
+ metadata.gz: e39fbfebed5714a9eeb9fe9e1e22e8bf0ac29e16b34c1683b0e35bd9bde3d754
4
+ data.tar.gz: d7a8363434c9e48dc134acbc863020e89d89bcc0af7c95148e4a9f0542a3554c
5
5
  SHA512:
6
- metadata.gz: b8e403df8684221a0521432017c511f8b0c4d174c97c95129f7952e6751914093fe692585127d2f0a267f9776b9a464062bd10e3f3a7d9aa7c772edcddde8d2e
7
- data.tar.gz: bd858f3f1c199b835ce22f567068af585f9ce41d2cd9da6811f5d06bbcc45ab1aadaa40575d1684bb2245d691c90589df420343a0233039f860030513037de75
6
+ metadata.gz: 8cd46477f0486ab53708fdae544736b1f7909de2cf707d63cef4c84b017bd360e4e14b4946a62b280614c29374bf063bbaee3f82171e04f7e916db6bc1ccbcec
7
+ data.tar.gz: 5d8b3303a2aa4f097ce1af9781d308a577f3fcb1054d356982ca9141b9b99cdecbdbc76315d4ed3f97a80825449a7ae06b90407a3a5cbecb282a20cbe38a42e7
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 2.4.0 / 2020-11-19
4
+
5
+ #### Features
6
+
7
+ * add support for != and NOT_IN queries
8
+
3
9
  ### 2.3.0 / 2020-09-30
4
10
 
5
11
  #### Features
@@ -216,6 +216,9 @@ module Google
216
216
  # * greater than: `>`, `gt`
217
217
  # * greater than or equal: `>=`, `gte`
218
218
  # * equal: `=`, `==`, `eq`, `eql`, `is`
219
+ # * not equal: `!=`
220
+ # * in: `in`
221
+ # * not in: `not-in`, `not_in`
219
222
  # * array contains: `array-contains`, `array_contains`
220
223
  # @param [Object] value A value the field is compared to.
221
224
  #
@@ -993,23 +996,20 @@ module Google
993
996
  "eq" => :EQUAL,
994
997
  "eql" => :EQUAL,
995
998
  "is" => :EQUAL,
999
+ "!=" => :NOT_EQUAL,
996
1000
  "array_contains" => :ARRAY_CONTAINS,
997
1001
  "array-contains" => :ARRAY_CONTAINS,
998
1002
  "include" => :ARRAY_CONTAINS,
999
1003
  "include?" => :ARRAY_CONTAINS,
1000
1004
  "has" => :ARRAY_CONTAINS,
1001
1005
  "in" => :IN,
1006
+ "not_in" => :NOT_IN,
1007
+ "not-in" => :NOT_IN,
1002
1008
  "array_contains_any" => :ARRAY_CONTAINS_ANY,
1003
1009
  "array-contains-any" => :ARRAY_CONTAINS_ANY
1004
1010
  }.freeze
1005
1011
  ##
1006
1012
  # @private
1007
- EQUALITY_FILTERS = %i[
1008
- EQUAL
1009
- ARRAY_CONTAINS
1010
- ].freeze
1011
- ##
1012
- # @private
1013
1013
  INEQUALITY_FILTERS = %i[
1014
1014
  LESS_THAN
1015
1015
  LESS_THAN_OR_EQUAL
@@ -1037,12 +1037,13 @@ module Google
1037
1037
  raise ArgumentError, "unknown operator #{op}" if operator.nil?
1038
1038
 
1039
1039
  if value_unary? value
1040
- if operator != :EQUAL
1041
- raise ArgumentError,
1042
- "can only check equality for #{value} values"
1043
- end
1044
-
1045
- operator = value_nan?(value) ? :IS_NAN : :IS_NULL
1040
+ operator = if operator == :EQUAL
1041
+ value_nan?(value) ? :IS_NAN : :IS_NULL
1042
+ elsif operator == :NOT_EQUAL
1043
+ value_nan?(value) ? :IS_NOT_NAN : :IS_NOT_NULL
1044
+ else
1045
+ raise ArgumentError, "can only perform '==' and '!=' comparisons on #{value} values"
1046
+ end
1046
1047
 
1047
1048
  return StructuredQuery::Filter.new(
1048
1049
  unary_filter: StructuredQuery::UnaryFilter.new(
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Firestore
19
- VERSION = "2.3.0".freeze
19
+ VERSION = "2.4.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-30 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core