age fields of all users, and sum their total age.
Group by one field.
Custom aggregation functions can be useful if you want to write your own storage-specific logic.
The following shows how to group by the
id and the
name of all users and calculate the average
age of their pets.