ARDELRANGE

ARDELRANGE key start end [start end ...]
Available since:
Redis Open Source 8.8.0
Time complexity:
Proportional to the number of existing elements / slices touched, not to the numeric span of the requested ranges
ACL categories:
ARRAY,

Deletes elements in one or more ranges.

Required arguments

key

The name of the key that holds the array.

range

One or more start end pairs, each defining an inclusive range of indices to delete. If start is greater than end for a given pair, the range is processed in ascending order regardless. Multiple pairs may overlap; each element is counted at most once.

Examples

ARMSET myarray 0 "a" 1 "b" 2 "c" 3 "d" 4 "e" ARDELRANGE myarray 1 3 ARCOUNT myarray ARGET myarray 0 ARGET myarray 4

Return information

Integer reply: Number of elements deleted.
RATE THIS PAGE
Back to top ↑