you need to use the HKEYS command. see example below:
redis> HSET myhash field1 "Hello"
(integer) 1
redis> HSET myhash field2 "World"
(integer) 1
redis> HKEYS myhash
1) "field1"
2) "field2"
Array response: a list of fields in the hash or an empty list if the key does not exist.
source
share