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

Redis Hget Command

Redis Hashes (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 Version

>= 2.0.0

Return Value

Returns the value of the given field. Returns nil if the given field or key does not exist.

Online Examples

# Field exists
redis> HSET site redis redis.com
(integer) 1
redis> HGET site redis
"redis.com"
# Field does not exist
redis> HGET site mysql
(nil)

Redis Hashes (Hash)