轻工具箱
← 返回手册

HVALS

Redis手册 / 哈希表

HVALS

HVALS key

返回哈希表 key 中所有域的值。

可用版本:>= 2.0.0

时间复杂度: O(N), N 为哈希表的大小。

返回值:

一个包含哈希表中所有值的表。 当 key 不存在时,返回一个空表。 1# 非空哈希表2 3redis> HMSET website google www.google.com yahoo www.yahoo.com4OK5 6redis> HVALS website71) "www.google.com"82) "www.yahoo.com"9 10 11# 空哈希表/不存在的key12 13redis> EXISTS not_exists14(integer) 015 16redis> HVALS not_exists17(empty list or set)```