Latest web development tutorials

comando Redis Hvals

Redis hash (hash)

Redis comando Hvals restituisce i valori della tabella hash per tutti i campi.

grammatica

Redis Hvals sintassi dei comandi di base è la seguente:

redis 127.0.0.1:6379> HVALS KEY_NAME FIELD VALUE 

versioni disponibili

> = 2.0.0

Valore di ritorno

Una tabella hash di tutti i valori contenuti nella tabella. Quando la chiave non esiste, restituisce un tavolo vuoto.

Esempi

redis 127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
redis 127.0.0.1:6379> HSET myhash field2 "bar"
(integer) 1
redis 127.0.0.1:6379> HVALS myhash
1) "foo"
2) "bar"

# 空哈希表/不存在的key

redis 127.0.0.1:6379> EXISTS not_exists
(integer) 0

redis 127.0.0.1:6379> HVALS not_exists
(empty list or set)

Redis hash (hash)