firebase / firebase/firebase-cpp-sdk

[FR] Add `SUM` Functionality to AggregateQuerySnapshot

オープン
#1,703 コメント 3 件 リアクション 0 件 担当者 1 名 @cherylEnkidu が担当を希望しています GitHub で見る
api: firestore type: feature request
主要言語
C++
スター
326
フォーク
137
平均マージ
3日 9時間
マージ済み PR(30日)
5

説明

### 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:
- https://github.com/firebase/firebase-cpp-sdk/blob/main/firestore/src/include/firebase/firestore/aggregate_query_snapshot.h#L109

### 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](https://github.com/firebase/flutterfire/blob/main/packages/cloud_firestore/cloud_firestore/windows/cloud_firestore_plugin.cpp#L1424-L1426), unsupported aggregation types like `sum` currently result in:
```dart
...
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,

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。