---
title: "HMGET"
url: "https://docs.yugabyte.com/stable/yedis/api/hmget/"
---

# HMGET

## Synopsis

**`HMGET key field [field ...]`**

This command fetches one or more values for the given fields of the hash that is associated with the given `key`.

- For every given `field`, (null) is returned if either `key` or `field` does not exist.
- If `key` is associated with a non-hash data, an error is raised.

## Return value

Returns list of string values of the fields in the same order that was requested.

## Examples

```sh
$ HMSET yugahash area1 "Africa" area2 "America"
```

```
"OK"
```

```sh
$ HMGET yugahash area1 area2 area_none
```

```
1) "Africa"
2) "America"
3) (null)
```

## See also

[`hdel`](/stable/yedis/api/hdel/ "hdel"), [`hexists`](/stable/yedis/api/hexists/ "hexists"), [`hget`](/stable/yedis/api/hget/ "hget"), [`hgetall`](/stable/yedis/api/hgetall/ "hgetall"), [`hkeys`](/stable/yedis/api/hkeys/ "hkeys"), [`hlen`](/stable/yedis/api/hlen/ "hlen"), [`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")
