public class AggregateQueryA 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 |
Firestorea Firestore instance to apply the query to. |
proto |
RunAggregationQueryRequestthe 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:
objectis a non-null instance of AggregateQuery.objectperforms the same aggregations as this AggregateQuery.- The underlying Query of
objectcompares equal to that of this object.
| Parameter | |
|---|---|
| Name | Description |
object |
ObjectThe object to compare to this object for equality. |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
explain(ExplainOptions options)
public ApiFuture<ExplainResults<AggregateQuerySnapshot>> explain(ExplainOptions options)Plans and optionally executes this query. Returns an ApiFuture that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any).
| Parameter | |
|---|---|
| Name | Description |
options |
ExplainOptions |
| Returns | |
|---|---|
| Type | Description |
ApiFuture<ExplainResults<AggregateQuerySnapshot>> |
An ApiFuture that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any). |
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 |