Redis - 雜湊 HVALS 命令



Redis HVALS 命令用於獲取儲存在鍵下的雜湊中的所有值。

返回值

陣列回覆、雜湊中的值列表或當鍵不存在時的空列表。

語法

以下是 Redis HVALS 命令的基本語法。

redis 127.0.0.1:6379> HVALS KEY_NAME FIELD VALUE

示例

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" 
redis_hashes.htm
廣告
© . All rights reserved.