Back to Redis

HVALS

content/commands/hvals.md

latest1.4 KB
Original Source

Returns all values in the hash stored at key.

Examples

{{< clients-example set="cmds_hash" step="hvals" description="Foundational: Retrieve all values from a hash using HVALS (returns only values without field names, useful when you only need the data)" difficulty="beginner" >}} redis> HSET myhash field1 "Hello" (integer) 1 redis> HSET myhash field2 "World" (integer) 1 redis> HVALS myhash

  1. "Hello"
  2. "World" {{< /clients-example >}}

Give these commands a try in the interactive console:

{{% redis-cli %}} HSET myhash field1 "Hello" HSET myhash field2 "World" HVALS myhash {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| 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> | |

Return information

{{< multitabs id="hvals-return-info" tab1="RESP2" tab2="RESP3" >}}

Array reply: a list of values in the hash, or an empty list when the key does not exist

-tab-sep-

Array reply: a list of values in the hash, or an empty list when the key does not exist.

{{< /multitabs >}}