sum

Aggregate

Sums the numeric values in an array. With a field argument, extracts that field from each object and sums the resulting numbers. Non-numeric values are treated as 0.

Syntaxsum:field?
fieldoptionalField name to sum from each object. Omit for arrays of numbers.

Use cases

All commands