Skip to main content

AROP

Aggregate values in an inclusive array range.
1 min read

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#

keystrrequired#

The array key.

startintrequired#

The first index of the inclusive range.

endintrequired#

The last index of the inclusive range.

operationstrrequired#

The reduction to apply. See the operations below.

valueValueT#

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.

Was this page helpful?