Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FR] Add SUM Functionality to AggregateQuerySnapshot #1703

Open
@KKimj

Description

Feature proposal

Firebase Component: Firestore

Hello,
The Firestore C++ SDK currently supports only the count() method in the firebase::firestore::AggregateQuerySnapshot class but lacks a sum() method (and avg()), which is essential for aggregating numeric fields across documents.

Current State

The public functions of AggregateQuerySnapshot are:

  • count()
  • is_valid()
  • Assignment operators (operator=)
  • query()

Reference:

Flutter SDK Implications

This enhancement would also benefit the Flutter SDK, which relies on the Firestore C++ SDK for Windows platform support. For example, in the FlutterFire plugin, unsupported aggregation types like sum currently result in:

...
 case AggregateType::sum:
 std::cout << "Sum is not supported on C++" << std::endl;
 break;
...

Adding sum() to the C++ SDK would also benefit Flutter developers using Firestore on Windows.

Benefits

Implementing a sum() method would:

  1. Provide access to Firestore's aggregation capabilities in the C++ SDK.
  2. Support more use cases for C++ and Flutter developers.

Looking forward to hearing thoughts and feedback!
Thanks,

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /