Class: Google::Cloud::Firestore::V1::StructuredQuery

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/firestore/v1/query.rb

Overview

A Firestore query.

Defined Under Namespace

Modules: Direction Classes: CollectionSelector, CompositeFilter, FieldFilter, FieldReference, Filter, Order, Projection, UnaryFilter

Instance Attribute Summary collapse

Instance Attribute Details

#end_at::Google::Cloud::Firestore::V1::Cursor

Returns A end point for the query results.

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#from::Array<::Google::Cloud::Firestore::V1::StructuredQuery::CollectionSelector>

Returns The collections to query.

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#limit::Google::Protobuf::Int32Value

Returns The maximum number of results to return.

Applies after all other constraints. Must be >= 0 if specified.

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#offset::Integer

Returns The number of results to skip.

Applies before limit, but after all other constraints. Must be >= 0 if specified.

Returns:

  • (::Integer)

    The number of results to skip.

    Applies before limit, but after all other constraints. Must be >= 0 if specified.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#order_by::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Order>

Returns The order to apply to the query results.

Firestore guarantees a stable ordering through the following rules:

  • Any field required to appear in order_by, that is not already specified in order_by, is appended to the order in field name order by default.
  • If an order on __name__ is not specified, it is appended by default.

Fields are appended with the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example:

  • SELECT * FROM Foo ORDER BY A becomes SELECT * FROM Foo ORDER BY A, __name__
  • SELECT * FROM Foo ORDER BY A DESC becomes SELECT * FROM Foo ORDER BY A DESC, __name__ DESC
  • SELECT * FROM Foo WHERE A > 1 becomes SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__.

Returns:

  • (::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Order>)

    The order to apply to the query results.

    Firestore guarantees a stable ordering through the following rules:

    • Any field required to appear in order_by, that is not already specified in order_by, is appended to the order in field name order by default.
    • If an order on __name__ is not specified, it is appended by default.

    Fields are appended with the same sort direction as the last order specified, or 'ASCENDING' if no order was specified. For example:

    • SELECT * FROM Foo ORDER BY A becomes SELECT * FROM Foo ORDER BY A, __name__
    • SELECT * FROM Foo ORDER BY A DESC becomes SELECT * FROM Foo ORDER BY A DESC, __name__ DESC
    • SELECT * FROM Foo WHERE A > 1 becomes SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__


72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#select::Google::Cloud::Firestore::V1::StructuredQuery::Projection

Returns The projection to return.

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#start_at::Google::Cloud::Firestore::V1::Cursor

Returns A starting point for the query results.

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end

#where::Google::Cloud::Firestore::V1::StructuredQuery::Filter

Returns The filter to apply.

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'proto_docs/google/firestore/v1/query.rb', line 72

class StructuredQuery
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A selection of a collection, such as `messages as m1`.
  # @!attribute [rw] collection_id
  #   @return [::String]
  #     The collection ID.
  #     When set, selects only collections with this ID.
  # @!attribute [rw] all_descendants
  #   @return [::Boolean]
  #     When false, selects only collections that are immediate children of
  #     the `parent` specified in the containing `RunQueryRequest`.
  #     When true, selects all descendant collections.
  class CollectionSelector
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter.
  # @!attribute [rw] composite_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter]
  #     A composite filter.
  # @!attribute [rw] field_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter]
  #     A filter on a document field.
  # @!attribute [rw] unary_filter
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter]
  #     A filter that takes exactly one argument.
  class Filter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A filter that merges multiple other filters using the given operator.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::CompositeFilter::Operator]
  #     The operator for combining multiple filters.
  # @!attribute [rw] filters
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::Filter>]
  #     The list of filters to combine.
  #     Must contain at least one filter.
  class CompositeFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A composite filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The results are required to satisfy each of the combined filters.
      AND = 1
    end
  end

  # A filter on a specific field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to filter by.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldFilter::Operator]
  #     The operator to filter by.
  # @!attribute [rw] value
  #   @return [::Google::Cloud::Firestore::V1::Value]
  #     The value to compare to.
  class FieldFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A field filter operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is less than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN = 1

      # The given `field` is less than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      LESS_THAN_OR_EQUAL = 2

      # The given `field` is greater than the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN = 3

      # The given `field` is greater than or equal to the given `value`.
      #
      # Requires:
      #
      # * That `field` come first in `order_by`.
      GREATER_THAN_OR_EQUAL = 4

      # The given `field` is equal to the given `value`.
      EQUAL = 5

      # The given `field` is not equal to the given `value`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_EQUAL = 6

      # The given `field` is an array that contains the given `value`.
      ARRAY_CONTAINS = 7

      # The given `field` is equal to at least one value in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      IN = 8

      # The given `field` is an array that contains any of the values in the
      # given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN` or `ARRAY_CONTAINS_ANY` or `NOT_IN`.
      ARRAY_CONTAINS_ANY = 9

      # The value of the `field` is not in the given array.
      #
      # Requires:
      #
      # * That `value` is a non-empty `ArrayValue` with at most 10 values.
      # * No other `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`,
      #   `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      NOT_IN = 10
    end
  end

  # A filter with a single operand.
  # @!attribute [rw] op
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::UnaryFilter::Operator]
  #     The unary operator to apply.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to which to apply the operator.
  class UnaryFilter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A unary operator.
    module Operator
      # Unspecified. This value must not be used.
      OPERATOR_UNSPECIFIED = 0

      # The given `field` is equal to `NaN`.
      IS_NAN = 2

      # The given `field` is equal to `NULL`.
      IS_NULL = 3

      # The given `field` is not equal to `NaN`.
      #
      # Requires:
      #
      # * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NAN = 4

      # The given `field` is not equal to `NULL`.
      #
      # Requires:
      #
      # * A single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`.
      # * That `field` comes first in the `order_by`.
      IS_NOT_NULL = 5
    end
  end

  # An order on a field.
  # @!attribute [rw] field
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference]
  #     The field to order by.
  # @!attribute [rw] direction
  #   @return [::Google::Cloud::Firestore::V1::StructuredQuery::Direction]
  #     The direction to order by. Defaults to `ASCENDING`.
  class Order
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A reference to a field, such as `max(messages.time) as max_time`.
  # @!attribute [rw] field_path
  #   @return [::String]
  class FieldReference
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The projection of document's fields to return.
  # @!attribute [rw] fields
  #   @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference>]
  #     The fields to return.
  #
  #     If empty, all fields are returned. To only return the name
  #     of the document, use `['__name__']`.
  class Projection
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A sort direction.
  module Direction
    # Unspecified.
    DIRECTION_UNSPECIFIED = 0

    # Ascending.
    ASCENDING = 1

    # Descending.
    DESCENDING = 2
  end
end