w3resource

Redis Hash: HVALS

HVALS key

Redis HVALS command is used to get all values in the hash stored at key.

Syntax:

HVALS KEY_NAME FIELD VALUE    

Available since

2.0.0.

Return Value

Array reply, a list of values in the hash, or an empty list when the key does not exist.

Return Value Type

Integer

Example: Redis HVALS

127.0.0.1:6379> HSET langhash lang1 "PHP"
(integer) 1
127.0.0.1:6379> HSET langhash lang2 "JavaScript"
(integer) 1
127.0.0.1:6379> HSET langhash lang3 "Python"
(integer) 1
127.0.0.1:6379> HVALS langhash
1) "PHP"
2) "JavaScript"
3) "Python"

Example: Redis HVALS another example

127.0.0.1:6379> HVALS user-y
1) "[email protected]"
2) "English"
3) "Male"
127.0.0.1:6379> HMSET user-x name Chima gender Male language English
OK
127.0.0.1:6379> HVALS user-x
1) "Chima"
2) "Male"
3) "English"

Previous: HSETNX
Next: HSCAN



Follow us on Facebook and Twitter for latest update.