googleapis / googleapis/google-cloud-node
[FR] [Firestore] Statistics aggregation function
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
**Is your feature request related to a problem? Please describe.**
Since firestore now has aggregate function. In addition to `sum()` `count()` and `average()` I would like to propose that we should have an aggregate function that will return both `.count` `.sum` `.sumSquare` in the same query. And so we can calculated both average and standard deviation along with presenting all statistics related value in one query
**Describe the solution you'd like**
There should be `stats()` function that return `.count` `.sum` `.sumSquare` and maybe `.min` `.max` in the returned aggregated object
**Describe alternatives you've considered**
Without aggregated function there are no optimal way to calculate standard deviation
Or could there possibly be custom aggregate function like couchdb in firebase system?
**Additional context**
This is actually borrowed idea from [couchdb `_stats` function](https://docs.couchbase.com/server/current/learn/views/views-writing-stats.html)
Contributor guide
Assessment
This issue has not been assessed yet.