无涯教程-Redis - HVALS命令函数

53 阅读1分钟

Redis HVALS 命令用于获取存储在键(key)处的哈希中的所有值。

HVALS - 返回值

返回值数组。

HVALS - 语法

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

redis 127.0.0.1:6379> HVALS KEY_NAME FIELD VALUE

HVALS - 示例

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" 

参考链接

www.learnfk.com/redis/hashe…