{
  "schema_version": 2,
  "id": "commands/zremrangebyscore",
  "title": "ZREMRANGEBYSCORE",
  "url": "https://redis.io/docs/latest/commands/zremrangebyscore/",
  "summary": "Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed.",
  "since": "1.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-24T11:07:00+02:00",
  "page_type": "content",
  "content_hash": "2fcc0fb26e3f20aec805260d36d0eaa28e14e0bf5607af0d15ede4f50eb125e1",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Removes all elements in the sorted set stored at `key` with a score between\n`min` and `max` (inclusive)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key that holds the sorted set.\n\n</details>\n\n<details open><summary><code>min</code></summary>\n\nThe minimum score. The bound is inclusive unless prefixed with `(`. Use `-inf` for no lower bound.\n\n</details>\n\n<details open><summary><code>max</code></summary>\n\nThe maximum score. The bound is inclusive unless prefixed with `(`. Use `+inf` for no upper bound.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> ZADD myzset 1 \"one\"\n(integer) 1\nredis> ZADD myzset 2 \"two\"\n(integer) 1\nredis> ZADD myzset 3 \"three\"\n(integer) 1\nredis> ZREMRANGEBYSCORE myzset -inf (2\n(integer) 1\nredis> ZRANGE myzset 0 -1 WITHSCORES\n1) \"two\"\n2) \"2\"\n3) \"three\"\n4) \"3\""
    },
    {
      "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\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of members removed.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): Number of members removed."
    }
  ],
  "examples": []
}
