Redis – Hash Hvals Command

  • Post author:
  • Post category:Redis
  • Post comments:2 Comments

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

Return Value

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

Syntax

Following is the basic syntax of Redis HVALS command.

redis 127.0.0.1:6379> HVALS KEY_NAME FIELD VALUE

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" 

This Post Has 2 Comments

Leave a Reply