Skip to main content
$sum computes the total of a field across matching documents. If missing is set, missing fields contribute that fallback value.

Compatibility

Field must be FAST.

Arguments

Output

value can be null when no values are available.