Returns the value of a field in a hash.
HGET key field
Returns the value associated with field in the hash stored at key.
One of the following:
Bulk string reply: The value associated with the field.
Nil reply: If the field is not present in the hash or key does not exist.
One of the following:
Bulk string reply: The value associated with the field.
Null reply: If the field is not present in the hash or key does not exist.
O(1)
@fast @hash @read
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)
HDEL, HEXISTS, HEXPIRE, HEXPIREAT, HEXPIRETIME, HGETALL, HGETDEL, HGETEX, HINCRBY, HINCRBYFLOAT, HKEYS, HLEN, HMGET, HMSET, HPERSIST, HPEXPIRE, HPEXPIREAT, HPEXPIRETIME, HPTTL, HRANDFIELD, HSCAN, HSET, HSETEX, HSETNX, HSTRLEN, HTTL, HVALS.