Skip to content

R.GETBITS / R64.GETBITS ​

Returns the values of several bits in one call.

SyntaxR.GETBITS key offset [offset ...]
64-bitR64.GETBITS key offset [offset ...]
Time complexityO(K) for K offsets

Arguments ​

  • key — the bitmap key
  • offset ... — one or more bit positions

Reply ​

Array of integers (0 or 1) in argument order. A missing key replies an empty array.

Example ​

bash
127.0.0.1:6379> R.SETINTARRAY k 1 3 5
OK
127.0.0.1:6379> R.GETBITS k 1 2 3
1) (integer) 1
2) (integer) 0
3) (integer) 1