HGET · Valkey

HGET

Returns the value of a field in a hash.

Usage

HGET key field

Description

Returns the value associated with field in the hash stored at key.

Reply RESP2

One of the following:

Reply RESP3

One of the following:

Complexity

O(1)

ACL Categories

@fast @hash @read

Examples

127.0.0.1:6379> HSET myhash field1 "foo"
(integer) 1
127.0.0.1:6379> HGET myhash field1
"foo"
127.0.0.1:6379> HGET myhash field2
(nil)

History

See also

HDEL, HEXISTS, HEXPIRE, HEXPIREAT, HEXPIRETIME, HGETALL, HGETEX, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, HMGET, HMSET, HPERSIST, HPEXPIRE, HPEXPIREAT, HPEXPIRETIME, HPTTL, HRANDFIELD, HSCAN, HSET, HSETEX, HSETNX, HSTRLEN, HTTL, HVALS.