Easy Tutorial
❮ Server Debug Segfault Server Bgrewriteaof ❯

Redis Hvals Command

Redis Hashes

The Redis Hvals command returns all the values in the hash table.

Syntax

The basic syntax of the redis Hvals command is as follows:

redis 127.0.0.1:6379> HVALS key

Available Versions

= 2.0.0

Return Value

A list containing all the values in the hash table. When the key does not exist, it returns an empty list.

Example

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"

# Empty hash table/non-existent 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 Hashes

❮ Server Debug Segfault Server Bgrewriteaof ❯