SUM, MIN, and MAX aggregate numeric values. AND, OR, and XOR fold values as 64-bit integers, truncating fractions. These operations skip non-numeric values. USED counts occupied slots. MATCH counts values equal to the supplied value.
Arguments#
The array key.
The first index of the inclusive range.
The last index of the inclusive range.
The reduction to apply. See the operations below.
The value to match. Required for MATCH; omit it for other operations.
Pass "SUM", "MIN", "MAX", "AND", "OR", "XOR", "USED", or "MATCH". For MATCH, also supply value.
Response#
int | float | Nonerequired
The numeric aggregate, or null (TypeScript) / None (Python) if no values can be used. USED and MATCH return zero for an empty range.
See the server command reference for protocol details.