English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Il comando Redis Getbit viene utilizzato per ottenere il bit(bit) specifico dell'offset della stringa memorizzata dal key.
Sintassi redis Getbit comando di base è il seguente:
redis 127.0.0.1:6379> GETBIT KEY_NAME OFFSET
>= 2.2.0
Valore della stringa specifica l'offset sul bit(bit).
Quando l'offset OFFSET è maggiore della lunghezza della stringa del valore o il key non esiste, restituisce 0.
# GETBIT per key inesistente o offset inesistente, restituisce 0 redis> EXISTS bit (intero) 0 redis> GETBIT bit 10086 (intero) 0 # GETBIT per offset esistente redis> SETBIT bit 10086 1 (intero) 0 redis> GETBIT bit 10086 (intero) 1