AROP
Since 1.1.0Arrays
Syntax
AROP key start end <SUM | MIN | MAX | AND | OR | XOR | MATCH value | USED>Computes over the filled slots from start to end.
| Operation | Reply |
|---|---|
SUM, MIN, MAX | over the numeric values, as a bulk string; nil if there are none |
AND, OR, XOR | of the integer values, as an integer |
MATCH value | how many values equal value |
USED | how many slots are filled |
Examples
> ARSET n 0 3 7 hello 10
(integer) 4
> AROP n 0 3 SUM
"20"
> AROP n 0 3 MAX
"10"
> AROP n 0 3 MATCH hello
(integer) 1
> AROP n 2 2 SUM
(nil)