proto_docs/google/firestore/v1/query.rb in google-cloud-firestore-v1-0.10.0 vs proto_docs/google/firestore/v1/query.rb in google-cloud-firestore-v1-0.11.0

- old
+ new

@@ -20,13 +20,25 @@ module Google module Cloud module Firestore module V1 # A Firestore query. + # + # The query stages are executed in the following order: + # 1. from + # 2. where + # 3. select + # 4. order_by + start_at + end_at + # 5. offset + # 6. limit # @!attribute [rw] select # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Projection] - # The projection to return. + # Optional sub-set of the fields to return. + # + # This acts as a {::Google::Cloud::Firestore::V1::DocumentMask DocumentMask} over the + # documents returned from a query. When not set, assumes that the caller + # wants all fields returned. # @!attribute [rw] from # @return [::Array<::Google::Cloud::Firestore::V1::StructuredQuery::CollectionSelector>] # The collections to query. # @!attribute [rw] where # @return [::Google::Cloud::Firestore::V1::StructuredQuery::Filter] @@ -241,29 +253,32 @@ # 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`. + # * That `value` is a non-empty `ArrayValue`, subject to disjunction + # limits. + # * No `NOT_IN` filters in the same query. 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`. + # * That `value` is a non-empty `ArrayValue`, subject to disjunction + # limits. + # * No other `ARRAY_CONTAINS_ANY` filters within the same disjunction. + # * No `NOT_IN` filters in the same query. 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`, + # * No other `OR`, `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 @@ -321,15 +336,16 @@ end # A reference to a field in a document, ex: `stats.operations`. # @!attribute [rw] field_path # @return [::String] - # The relative path of the document being referenced. + # A reference to a field in a document. # # Requires: # - # * Conform to {::Google::Cloud::Firestore::V1::Document#fields document field name} + # * MUST be a dot-delimited (`.`) string of segments, where each segment + # conforms to {::Google::Cloud::Firestore::V1::Document#fields document field name} # limitations. class FieldReference include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end @@ -374,14 +390,20 @@ # * A minimum of one and maximum of five aggregations per query. class StructuredAggregationQuery include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods - # Defines a aggregation that produces a single result. + # Defines an aggregation that produces a single result. # @!attribute [rw] count # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Count] # Count aggregator. + # @!attribute [rw] sum + # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Sum] + # Sum aggregator. + # @!attribute [rw] avg + # @return [::Google::Cloud::Firestore::V1::StructuredAggregationQuery::Aggregation::Avg] + # Average aggregator. # @!attribute [rw] alias # @return [::String] # Optional. Optional name of the field to store the result of the # aggregation into. # @@ -391,11 +413,11 @@ # ``` # AGGREGATE # COUNT_UP_TO(1) AS count_up_to_1, # COUNT_UP_TO(2), # COUNT_UP_TO(3) AS count_up_to_3, - # COUNT_UP_TO(4) + # COUNT(*) # OVER ( # ... # ); # ``` # @@ -404,11 +426,11 @@ # ``` # AGGREGATE # COUNT_UP_TO(1) AS count_up_to_1, # COUNT_UP_TO(2) AS field_1, # COUNT_UP_TO(3) AS count_up_to_3, - # COUNT_UP_TO(4) AS field_2 + # COUNT(*) AS field_2 # OVER ( # ... # ); # ``` # @@ -429,11 +451,11 @@ # @return [::Google::Protobuf::Int64Value] # Optional. Optional constraint on the maximum number of documents to # count. # # This provides a way to set an upper bound on the number of documents - # to scan, limiting latency and cost. + # to scan, limiting latency, and cost. # # Unspecified is interpreted as no bound. # # High-Level Example: # @@ -443,9 +465,57 @@ # # Requires: # # * Must be greater than zero when present. class Count + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Sum of the values of the requested field. + # + # * Only numeric values will be aggregated. All non-numeric values + # including `NULL` are skipped. + # + # * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + # follows IEEE-754 standards. + # + # * If the aggregated value set is empty, returns 0. + # + # * Returns a 64-bit integer if all aggregated numbers are integers and the + # sum result does not overflow. Otherwise, the result is returned as a + # double. Note that even if all the aggregated values are integers, the + # result is returned as a double if it cannot fit within a 64-bit signed + # integer. When this occurs, the returned value will lose precision. + # + # * When underflow occurs, floating-point aggregation is non-deterministic. + # This means that running the same query repeatedly without any changes to + # the underlying values could produce slightly different results each + # time. In those cases, values should be stored as integers over + # floating-point numbers. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to aggregate on. + class Sum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Average of the values of the requested field. + # + # * Only numeric values will be aggregated. All non-numeric values + # including `NULL` are skipped. + # + # * If the aggregated values contain `NaN`, returns `NaN`. Infinity math + # follows IEEE-754 standards. + # + # * If the aggregated value set is empty, returns `NULL`. + # + # * Always returns the result as a double. + # @!attribute [rw] field + # @return [::Google::Cloud::Firestore::V1::StructuredQuery::FieldReference] + # The field to aggregate on. + class Avg include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end