Redis Hget Command

Redis Hash

The Redis Hget command is used to return the value of the specified field in the hash table.

Syntax

The basic syntax of the Redis Hget command is as follows:

redis 127.0.0.1:6379> HGET KEY_NAME FIELD_NAME 

Available Versions

>= 2.0.0

Return Value

Returns the value of the given field. If the given field or key does not exist, nil is returned.

Example

Example

> HSET site redis redis.com
1
> HGET site redis
"redis.com"
> HGET site mysql
(nil)

Redis Hash

Other Extensions