Skip to main content

Aggregate Queries Return Arrays

In versions prior to v0.24.0 aggregate queries returned a single response with just the aggregated values. In v0.25.0 we have introduced a new groupBy option that requires aggregates to return arrays. When using aggregates without the groupBy the response will always contain a single record with your aggregated values. If you specify a groupBy you will get a response with a distinct group and the corresponding aggregated values. Given the following query

Old

The old response would look like

New

The new response will look like

New Aggregate GroupBy

The new response format really shines when using the groupBy query Given the following aggregate grouping on completed
You’ll get the following response with record for each distinct group
Edit this page