Skip to content

R.SETBITARRAY / R64.SETBITARRAY ​

Replaces the bitmap from an ASCII bit string: the byte at index i sets bit i when it is 1.

SyntaxR.SETBITARRAY key bitstring
64-bitR64.SETBITARRAY key bitstring
Time complexityO(L) for string length L

Arguments ​

  • key — the bitmap key (existing content is discarded)
  • bitstring — a string of 0/1 characters; any other byte (including non-UTF-8 bytes) counts as 0 and still occupies its position

Reply ​

Simple string OK.

Example ​

bash
127.0.0.1:6379> R.SETBITARRAY k 0101
OK
127.0.0.1:6379> R.GETINTARRAY k
1) (integer) 1
2) (integer) 3