HMGET

Syntax
HMGET key field [field ...]
Available since:
2.0.0
Time complexity:
O(N) where N is the number of fields being requested.
ACL categories:
@read, @hash, @fast,

返回存储在key中的哈希表中与指定fields相关联的值。

对于哈希中不存在的每个field,将返回一个nil值。 因为不存在的键被视为空哈希,所以对不存在的key运行HMGET将返回一个nil值的列表。

HSET myhash field1 "Hello" HSET myhash field2 "World" HMGET myhash field1 field2 nofield

RESP2/RESP3 回复

Array reply: a list of values associated with the given fields, in the same order as they are requested.
RATE THIS PAGE
Back to top ↑