English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Comando Redis Getbit

Stringa(string) Redis

Il comando Redis Getbit viene utilizzato per ottenere il bit(bit) specifico dell'offset della stringa memorizzata dal key.

Sintassi

Sintassi redis Getbit comando di base è il seguente:

redis 127.0.0.1:6379> GETBIT KEY_NAME OFFSET

Versioni disponibili

>= 2.2.0

Valore di ritorno

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.

Esempio online

# 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

Stringa(string) Redis