HMGET
This page documents the preview (v2.21) version. Preview includes features under active development and is for development and testing only. For production, use the stable (v2024.1) version.
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 eitherkeyorfielddoes not exist. - If
keyis 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
$ HMSET yugahash area1 "Africa" area2 "America"
"OK"
$ HMGET yugahash area1 area2 area_none
1) "Africa"
2) "America"
3) (null)
See also
hdel, hexists, hget, hgetall, hkeys, hlen, hmset, hset, hincrby, hstrlen, hvals