Back to Redis

HEXISTS

content/commands/hexists.md

latest1.3 KB
Original Source

Returns if field is an existing field in the hash stored at key.

Examples

{{% redis-cli %}} HSET myhash field1 "foo" HEXISTS myhash field1 HEXISTS myhash field2 {{% /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="hexists-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

  • Integer reply: 0 if the hash does not contain the field, or the key does not exist.
  • Integer reply: 1 if the hash contains the field.

-tab-sep-

One of the following:

  • Integer reply: 0 if the hash does not contain the field, or the key does not exist.
  • Integer reply: 1 if the hash contains the field.

{{< /multitabs >}}