Skip to content

R64.RANGEINTARRAY

CategoryDescription
SyntaxR64.RANGEINTARRAY key start end
Time complexityO(C)
Supports structuresBitmap64
Command descriptionReturns the offsets of the bits that have a value of 1 within the specified range.

Parameter

  • key: The name of the Roaring bitmap key.
  • start: The start value of the interval (inclusive).
  • end: The end value of the interval (inclusive).

Output

  • If the operation is successful, the offsets of the bits that have a value of 1 are returned.
  • If the key does not exist, an empty array is returned.
  • Otherwise, an error message is returned.

Examples

Basic Usage

$ redis-cli
127.0.0.1:6379> R64.SETINTARRAY foo 1 2 3 5 6 7 8 9 10
127.0.0.1:6379> R64.RANGEINTARRAY foo 0 5
1) "1"
2) "2"
3) "3"
4) "5"
5) "6"
6) "7"

Usage Notes

  • The maximum range size is limited to 100,000,000 elements to prevent excessive memory usage
  • To properly handle bigint values, use RESP3 protocol; otherwise the result will be returned as a string