---
title: "HGET"
url: "https://docs.yugabyte.com/stable/yedis/api/hget/"
---

# HGET

## Synopsis

**`HGET key field`**

This command fetches the value for the given `field` in the hash that is specified by the given `key`.

- If the given `key` or `field` does not exist, nil is returned.
- If the given `key` is associated with non-hash data, an error is raised.

## Return value

Returns the value for the given `field`

## Examples

```sh
$ HSET yugahash area1 "America"
```

```
1
```

```sh
$ HGET yugahash area1
```

```
"America"
```

## See also

[`hdel`](/stable/yedis/api/hdel/ "hdel"), [`hexists`](/stable/yedis/api/hexists/ "hexists"), [`hgetall`](/stable/yedis/api/hgetall/ "hgetall"), [`hkeys`](/stable/yedis/api/hkeys/ "hkeys"), [`hlen`](/stable/yedis/api/hlen/ "hlen"), [`hmget`](/stable/yedis/api/hmget/ "hmget"), [`hmset`](/stable/yedis/api/hmset/ "hmset"), [`hset`](/stable/yedis/api/hset/ "hset"), [`hincrby`](/stable/yedis/api/hincrby/ "hincrby"), [`hstrlen`](/stable/yedis/api/hstrlen/ "hstrlen"), [`hvals`](/stable/yedis/api/hvals/ "hvals")
