R.RANGEINTARRAY / R64.RANGEINTARRAY
Paginates the sorted value array: returns the elements at 0-based positions start through end.
| Syntax | R.RANGEINTARRAY key start end |
| 64-bit | R64.RANGEINTARRAY key start end |
| Time complexity | O(K log N) for a K-wide window |
Arguments
- key — the bitmap key
- start — 0-based index of the first element to return
- end — 0-based index of the last element to return (inclusive)
Reply
Array of integers; truncated at the cardinality; empty for a missing key or an inverted range.
Notes
start/endare positions, not values — this is the pagination companion toGETINTARRAY.- The window may span at most
valkey-roaring.max-reply-elementspositions (100,000,000 by default); wider windows are rejected withRoaring: range too large: maximum 100000000 elements(or the configured value; see Configuration). - One exception: the full-width request (
0to 4294967295, or to 18446744073709551615 for R64) lists the whole bitmap, and is refused only when the bitmap holds more values than that limit. - 64-bit positions are full unsigned 64-bit numbers: a window past the cardinality is simply empty.
Example
bash
127.0.0.1:6379> R.SETINTARRAY k 5 10 15 20 25 30
OK
127.0.0.1:6379> R.RANGEINTARRAY k 1 3
1) (integer) 10
2) (integer) 15
3) (integer) 20
127.0.0.1:6379> R.RANGEINTARRAY k 4 100
1) (integer) 25
2) (integer) 30