{
  "schema_version": 2,
  "id": "commands/zrevrangebyscore",
  "title": "ZREVRANGEBYSCORE",
  "url": "https://redis.io/docs/latest/commands/zrevrangebyscore/",
  "summary": "Returns members in a sorted set within a range of scores in reverse order.",
  "since": "2.2.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:43+01:00",
  "page_type": "content",
  "content_hash": "6ba4d66f7b85386b7bf9ce3dc94b6393b9d4c4782ac7fcb5c0a7f2d0043afb9f",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns all the elements in the sorted set at `key` with a score between `max`\nand `min` (including elements with score equal to `max` or `min`).\nIn contrary to the default ordering of sorted sets, for this command the\nelements are considered to be ordered from high to low scores.\n\nThe elements having the same score are returned in reverse lexicographical\norder.\n\nApart from the reversed ordering, `ZREVRANGEBYSCORE` is similar to\n[`ZRANGEBYSCORE`](https://redis.io/docs/latest/commands/zrangebyscore)."
    },
    {
      "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>max</code></summary>\n\nThe maximum score. The bound is inclusive unless prefixed with `(`. Use `+inf` for no upper bound.\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>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>WITHSCORES</code></summary>\n\nAlso return the score of each member.\n\n</details>\n\n<details open><summary><code>LIMIT offset count</code></summary>\n\nSkip `offset` matching members and return up to `count` of them. A negative `count` returns all remaining members.\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> ZREVRANGEBYSCORE myzset +inf -inf\n1) \"three\"\n2) \"two\"\n3) \"one\"\nredis> ZREVRANGEBYSCORE myzset 2 1\n1) \"two\"\n2) \"one\"\nredis> ZREVRANGEBYSCORE myzset 2 (1\n1) \"two\"\nredis> ZREVRANGEBYSCORE myzset (2 (1\n(empty array)"
    },
    {
      "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> | Deprecated as of Redis v6.2.0. |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n* [Array reply](../../develop/reference/protocol-spec#arrays): a list of the members and, optionally, their scores in the specified score range.\n\n**RESP3:**\n\n* [Array reply](../../develop/reference/protocol-spec#arrays): a list of the members and, optionally, their scores in the specified score range."
    }
  ],
  "examples": []
}
