= 2." />



English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Hkeys Command

Redis Hashes (Hash)

The Redis Hkeys command is used to get all fields (field) in the hash table.

Syntax

Basic Syntax of Redis Hkeys Command

redis 127.0.0.1:6379> HKEYS key 

Available Version

=> 2.0.0

Return Value

Contains a list of all fields (field) in the hash table. Returns an empty list if the key does not exist.

Online Examples

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> HKEYS myhash
1) "field1"
2) "field2"

Redis Hashes (Hash)