data method

Map<String, Object?> data()

All the results: keyed by the user-chosen aliases for a query made with Query.aggregateWithAliases, by the default alias of each aggregation (count, sum_<field>, average_<field>) otherwise.

Implementation

Map<String, Object?> data() {
  final Map<String, AggregateField>? aliases = query.aliases;
  if (aliases != null) {
    return Map<String, Object?>.unmodifiable(<String, Object?>{
      for (final MapEntry<String, AggregateField> entry in aliases.entries)
        entry.key: get(entry.value),
    });
  }
  return Map<String, Object?>.unmodifiable(<String, Object?>{
    for (final MapEntry<String, FieldValue> entry in _data.entries)
      entry.key: entry.value.value,
  });
}