public class AggregateQuery
A query that calculates aggregations over an underlying query.
Static Methods
fromProto(Firestore firestore, RunAggregationQueryRequest proto)
public static AggregateQuery fromProto(Firestore firestore, RunAggregationQueryRequest proto)
Returns an AggregateQuery instance that can be used to execute the provided RunAggregationQueryRequest.
Only RunAggregationQueryRequests that pertain to the same project as the Firestore instance can be deserialized.
Parameters | |
---|---|
Name | Description |
firestore | Firestore a Firestore instance to apply the query to. |
proto | RunAggregationQueryRequest the serialized RunAggregationQueryRequest. |
Returns | |
---|---|
Type | Description |
AggregateQuery | a AggregateQuery instance that can be used to execute the RunAggregationQueryRequest. |
Methods
equals(Object object)
public boolean equals(Object object)
Compares this object with the given object for equality.
This object is considered "equal" to the other object if and only if all of the following conditions are satisfied:
object
is a non-null instance of AggregateQuery.object
performs the same aggregations as this AggregateQuery.- The underlying Query of
object
compares equal to that of this object.
Parameter | |
---|---|
Name | Description |
object | Object The object to compare to this object for equality. |
Returns | |
---|---|
Type | Description |
boolean |
|
get()
public ApiFuture<AggregateQuerySnapshot> get()
Executes this query.
Returns | |
---|---|
Type | Description |
ApiFuture<AggregateQuerySnapshot> | An ApiFuture that will be resolved with the results of the query. |
getQuery()
public Query getQuery()
Returns the query whose aggregations will be calculated by this object.
Returns | |
---|---|
Type | Description |
Query |
hashCode()
public int hashCode()
Calculates and returns the hash code for this object.
Returns | |
---|---|
Type | Description |
int | the hash code for this object. |
toProto()
public RunAggregationQueryRequest toProto()
Returns the RunAggregationQueryRequest that this AggregateQuery instance represents. The request contain the serialized form of all aggregations and Query constraints.
Returns | |
---|---|
Type | Description |
RunAggregationQueryRequest | the serialized RunAggregationQueryRequest |