Redis Hvals コマンド

Redis ハッシュ(Hash)

Redis Hvals コマンドは、ハッシュテーブルのすべての値を返します。

構文

redis Hvals コマンドの基本的な構文は次のとおりです:

redis 127.0.0.1:6379> HVALS key

利用可能なバージョン

>= 2.0.0

戻り値

ハッシュテーブル内のすべての値を含むリスト。 key が存在しない場合は、空のリストを返します。

例

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"

# 空哈希表/不存在的key

redis 127.0.0.1:6379> EXISTS not_exists
(integer) 0

redis 127.0.0.1:6379> HVALS not_exists
(empty list or set)

Redis ハッシュ(Hash)

その他の拡張