AggregateQuerySnapshot class

A class that represents the result of an aggregation query.

This snapshot provides access to the aggregated data such as count, sum, or average.

Parameters:

  • query: The query whose aggregation results are in this snapshot.
  • data: The raw aggregation data (optional).

Returns: An instance of AggregateQuerySnapshot.

Example:

var snapshot = await aggregateQuery.get();
print(snapshot.count);

Constructors

AggregateQuerySnapshot({required Query<Object?> query, dynamic data})

Properties

count ↔ int?
getter/setter pair
data ↔ dynamic
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
query → Query<Object?>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAverage(String field) → double?
Retrieves the average value for the specified field from the aggregation data.
getSum(String field) → double?
Retrieves the sum value for the specified field from the aggregation data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited