Hashes Hgetall
# Redis Hgetall Command
[!(#) Redis Hashes](#)
The Redis Hgetall command is used to retrieve all fields and values from a hash.
In the returned value, each field name is immediately followed by its corresponding value, so the length of the return value is twice the size of the hash.
### Syntax
The basic syntax of the Redis Hgetall command is as follows:
redis 127.0.0.1:6379> HGETALL KEY_NAME
### Available Versions
>= 2.0.0
### Return Value
Returns the fields and values of the hash as a list. If the key does not exist, an empty list is returned.
### Example
redis> HSET myhash field1 "Hello"(integer) 1 redis> HSET myhash field2 "World"(integer) 1 redis> HGETALL myhash 1) "field1"2) "Hello"3) "field2"4) "World" redis>
[!(#) Redis Hashes](#)
AI is thinking...
[](#)(#)
(#)[](#)
[The Byte Ark Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., with official direct supply that is stable and reliable. Configuration guide Β₯9.9/month Activate now]( Starry Sky Coding Plan includes free models
YouTip