{
  "schema_version": 2,
  "id": "commands/delex",
  "title": "DELEX",
  "url": "https://redis.io/docs/latest/commands/delex/",
  "summary": "Conditionally removes the specified key based on value or hash digest comparison.",
  "since": "8.4.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:12+01:00",
  "page_type": "content",
  "content_hash": "d88c72ed8445ed0a4c1bdf861e8acb3006aed092fd2b038e37652a690a91cd44",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Conditionally removes the specified key based on value or hash digest comparison."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key to delete.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "The following options condition the deletion on the key's current value or [hash digest](#hash-digest). Only one may be specified.\n\n<details open><summary><code>IFEQ ifeq-value</code></summary>\n\nDelete the key only if its value is equal to `ifeq-value`.\n\n</details>\n\n<details open><summary><code>IFNE ifne-value</code></summary>\n\nDelete the key only if its value is not equal to `ifne-value`.\n\n</details>\n\n<details open><summary><code>IFDEQ ifdeq-digest</code></summary>\n\nDelete the key only if its hash digest is equal to `ifdeq-digest`.\n\n</details>\n\n<details open><summary><code>IFDNE ifdne-digest</code></summary>\n\nDelete the key only if its hash digest is not equal to `ifdne-digest`.\n\n</details>\n\nIn 8.4, keys must be of type string when using one of the options above. If no options are specified, the key is removed regardless of its type."
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "hash-digest",
      "title": "Hash Digest",
      "role": "content",
      "text": "A hash digest is a fixed-size numerical representation of a string value, computed using the XXH3 hash algorithm. Redis uses this hash digest for efficient comparison operations without needing to compare the full string content. You can retrieve a key's hash digest using the [`DIGEST`](https://redis.io/docs/latest/commands/digest) command, which returns it as a hexadecimal string that you can use with the `IFDEQ` and `IFDNE` options, and also the [`SET`](https://redis.io/docs/latest/commands/set) command's `IFDEQ` and `IFDNE` options."
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n- [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): 0 if not deleted (the key does not exist or a specified `IFEQ/IFNE/IFDEQ/IFDNE` condition is false), or 1 if deleted.\n- [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) if the key exists but holds a value that is not a string and one of `IFEQ, IFNE, IFDEQ,` or `IFDNE` is specified.\n\n**RESP3:**\n\nOne of the following:\n- [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): 0 if not deleted (the key does not exist or a specified `IFEQ/IFNE/IFDEQ/IFDNE` condition is false), or 1 if deleted.\n- [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) if the key exists but holds a value that is not a string and one of `IFEQ, IFNE, IFDEQ,` or `IFDNE` is specified."
    }
  ],
  "examples": []
}
