GETBIT

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Get a BIT value

offset starts from 0.

Example

Command>set key A
Result>OK
Command>getbit key 6
Result>0
Command>getbit key 7
Result>1
Command>getbit key 100   Returns 0 if the bit does not exist
Result>0

View animation



Syntax

GETBIT key offset

  • Available since version 2.2.0.
  • Time complexity is O(1).
Related commands SETBIT, BITOP, BITCOUNT, BITPOS
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< SETBIT GETBIT BITOP >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.