content/commands/hget.md
Returns the value associated with field in the hash stored at key.
{{< clients-example set="cmds_hash" step="hget" description="Foundational: Retrieve a single field value from a hash using HGET (returns nil if field or key doesn't exist)" difficulty="beginner" >}}
HSET myhash field1 "foo" (integer) 1 HGET myhash field1 "foo" HGET myhash field2 (nil) {{< /clients-example >}}
Give these commands a try in the interactive console:
{{% redis-cli %}} HSET myhash field1 "foo" HGET myhash field1 HGET myhash field2 {{% /redis-cli %}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="hget-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
-tab-sep-
One of the following:
{{< /multitabs >}}