💻Writing Your First Aggregation
A guide to writing your first aggregation
Aggregations refers to when you group a collection by a certain field and then take a metric when it is grouped.
An example of an aggregation query can be found as below:
The available groupby types are:
category (groupby a field that is a category)
numeric (groupby a field that is numeric)
Metrics are the fields you want to calculate in each of these every aggregation includes a frequency metric. These are the available metric types:
average
max
min
sum
cardinality
To help memorise the aggregation queries, the following example can help:
In this example, we aggregate by 2 separate categories (region and player name). Based on each category, the average, max, sum of scores is calculated and the average and maximum number of deaths are calculated.
Last updated