[FR] Add `SUM` Functionality to AggregateQuerySnapshot
@cherylEnkidu is already working on this.
Since Mar 31, 2025.
Assessment
This issue has not been assessed yet.
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:
- Provide access to Firestore's aggregation capabilities in the C++ SDK.
- Support more use cases for C++ and Flutter developers.
Looking forward to hearing thoughts and feedback!
Thanks,
- Dominant language
- C++
- Stars
- 326
- Forks
- 138
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from firebase/firebase-cpp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
firebase/firebase-cpp-sdk#1905 · 2 comments ·
-
api: firestore
Difficulty 5/5 Over a week Newbie friendliness 35/100
firebase/firebase-cpp-sdk#1920 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
firebase/firebase-cpp-sdk#1904 · 1 comment ·
-
new type: question
Difficulty 4/5 3-5 days Newbie friendliness 45/100
firebase/firebase-cpp-sdk#1892 · 1 comment ·
-
nightly-testing
Difficulty 4/5 3-5 days Newbie friendliness 25/100
firebase/firebase-cpp-sdk#1859 ·
All issues in firebase/firebase-cpp-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
brave/brave-browser#59300 ·
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main Openai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ydb-platform/ydb#53974 · 3 comments ·