Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Hget Command

Redis Hget Command

Redis Hash

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

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. If the given field or key does not exist, returns nil.

Example

Example

HSET site redis redis.com

1

HGET site redis

"redis.com"

HGET site mysql

(

nil

)

Redis Hash