Skip to content

R.GETBIT / R64.GETBIT ​

Returns the value of one bit.

SyntaxR.GETBIT key offset
64-bitR64.GETBIT key offset
Time complexityO(1)

Arguments ​

  • key — the bitmap key
  • offset — the bit position

Reply ​

Integer: 0 or 1. A missing key reads as all-zero — R.GETBIT answers 0 for it without validating the offset, R64.GETBIT validates first.

Example ​

bash
127.0.0.1:6379> R.GETBIT k 42
(integer) 1
127.0.0.1:6379> R.GETBIT missing 42
(integer) 0