Back to Firebase Js Sdk

AggregateQuerySnapshot class

docs-devsite/firestore_lite.aggregatequerysnapshot.md

12.12.12.5 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

AggregateQuerySnapshot class

The results of executing an aggregation query.

<b>Signature:</b>

typescript
export declare class AggregateQuerySnapshot<AggregateSpecType extends AggregateSpec, AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> 

Properties

PropertyModifiersTypeDescription
queryQuery<!-- --><AppModelType, DbModelType>The underlying query over which the aggregations recorded in this <code>AggregateQuerySnapshot</code> were performed.
type(not declared)A type string to uniquely identify instances of this class.

Methods

MethodModifiersDescription
data()Returns the results of the aggregations performed over the underlying query.<!-- -->The keys of the returned object will be the same as those of the <code>AggregateSpec</code> object specified to the aggregation method, and the values will be the corresponding aggregation result.

AggregateQuerySnapshot.query

The underlying query over which the aggregations recorded in this AggregateQuerySnapshot were performed.

<b>Signature:</b>

typescript
readonly query: Query<AppModelType, DbModelType>;

AggregateQuerySnapshot.type

A type string to uniquely identify instances of this class.

<b>Signature:</b>

typescript
readonly type = "AggregateQuerySnapshot";

AggregateQuerySnapshot.data()

Returns the results of the aggregations performed over the underlying query.

The keys of the returned object will be the same as those of the AggregateSpec object specified to the aggregation method, and the values will be the corresponding aggregation result.

<b>Signature:</b>

typescript
data(): AggregateSpecData<AggregateSpecType>;

<b>Returns:</b>

AggregateSpecData<!-- --><AggregateSpecType>

The results of the aggregations performed over the underlying query.