Upstash Documentation

$sum

1 min read

$sum computes the total of a field across matching documents.

If missing is set, missing fields contribute that fallback value.

Compatibility#

Field TypeSupported
TEXTNo
U64/I64/F64Yes
DATEYes
BOOLYes
KEYWORDNo
FACETNo

Field must be FAST.

Arguments#

ArgumentTypeRequiredDescription
fieldstringYesField to aggregate.
missingnumberNoFallback value for missing fields.

Output#

value can be null when no values are available.