HGETALL

Syntax
HGETALL key
Available since:
2.0.0
Time complexity:
O(N) where N is the size of the hash.
ACL categories:
@read, @hash, @slow,

返回存储在key处的哈希的所有字段和值。 在返回值中,每个字段名称后面都跟着它的值,因此回复的长度是哈希大小的两倍。

示例

HSET myhash field1 "Hello" HSET myhash field2 "World" HGETALL myhash

RESP2 回复

Array reply: a list of fields and their values stored in the hash, or an empty list when key does not exist.

RESP3 回复

Map reply: a map of fields and their values stored in the hash, or an empty list when key does not exist.
RATE THIS PAGE
Back to top ↑