Class AggregateQuery (7.6.0)

A query that calculates aggregations over an underlying query.

Package

@google-cloud/firestore

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the AggregateQuery class.

Properties

query

get query(): Query<AppModelType, DbModelType>;

The query whose aggregations will be calculated by this object.

Methods

explain(options)

explain(options?: firestore.ExplainOptions): Promise<ExplainResults<AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>>>;

Plans and optionally executes this query. Returns a Promise that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any).

A Promise that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any).

Parameter
NameDescription
options firestore.ExplainOptions
Returns
TypeDescription
Promise<ExplainResults<AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>>>

get()

get(): Promise<AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>>;

Executes this query.

A promise that will be resolved with the results of the query.

Returns
TypeDescription
Promise<AggregateQuerySnapshot<AggregateSpecType, AppModelType, DbModelType>>

isEqual(other)

isEqual(other: firestore.AggregateQuery<AggregateSpecType, AppModelType, DbModelType>): boolean;

Compares this object with the given object for equality.

This object is considered "equal" to the other object if and only if other performs the same aggregations as this AggregateQuery and the underlying Query of other compares equal to that of this object using Query.isEqual().

Parameter
NameDescription
other FirebaseFirestore.AggregateQuery<AggregateSpecType, AppModelType, DbModelType>

The object to compare to this object for equality. true if this object is "equal" to the given object, as defined above, or false otherwise.

Returns
TypeDescription
boolean