{
  "schema_version": 2,
  "id": "commands/bzmpop",
  "title": "BZMPOP",
  "url": "https://redis.io/docs/latest/commands/bzmpop/",
  "summary": "Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.",
  "since": "7.0.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": "e6b35fbe47db65e4d4cb1253cfe904ec4afcd6c7bb10c464776d0f91ada5f8fc",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "> [!NOTE]\n> This command's behavior varies in clustered Redis environments. See the [multi-key operations](https://redis.io/docs/latest/develop/using-commands/multi-key-operations) page for more information.\n\n\n`BZMPOP` is the blocking variant of [`ZMPOP`](https://redis.io/docs/latest/commands/zmpop).\n\nWhen any of the sorted sets contains elements, this command behaves exactly like [`ZMPOP`](https://redis.io/docs/latest/commands/zmpop).\nWhen used inside a [`MULTI`](https://redis.io/docs/latest/commands/multi)/[`EXEC`](https://redis.io/docs/latest/commands/exec) block or a Lua script, this command behaves exactly like [`ZMPOP`](https://redis.io/docs/latest/commands/zmpop).\nWhen all sorted sets are empty, Redis will block the connection until another client adds members to one of the keys or until the `timeout` (a double value specifying the maximum number of seconds to block) elapses.\nA `timeout` of zero can be used to block indefinitely.\n\nSee [`ZMPOP`](https://redis.io/docs/latest/commands/zmpop) for more information."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>timeout</code></summary>\n\nThe maximum time to block, in seconds. A timeout of `0` blocks indefinitely.\n\n</details>\n\n<details open><summary><code>numkeys</code></summary>\n\nThe number of keys that follow.\n\n</details>\n\n<details open><summary><code>key [key ...]</code></summary>\n\nOne or more sorted-set keys to pop from.\n\n</details>\n\n<details open><summary><code>MIN | MAX</code></summary>\n\nPop the members with the lowest scores (`MIN`) or the highest scores (`MAX`).\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>COUNT count</code></summary>\n\nThe number of members to pop. Defaults to 1.\n\n</details>"
    },
    {
      "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* [Nil reply](../../develop/reference/protocol-spec#bulk-strings): when no element could be popped.\n* [Array reply](../../develop/reference/protocol-spec#arrays): a two-element array with the first element being the name of the key from which elements were popped, and the second element is an array of the popped elements. Every entry in the elements array is also an array that contains the member and its score.\n\n**RESP3:**\n\nOne of the following:\n* [Null reply](../../develop/reference/protocol-spec#nulls): when no element could be popped.\n* [Array reply](../../develop/reference/protocol-spec#arrays): a two-element array with the first element being the name of the key from which elements were popped, and the second element is an array of the popped elements. Every entry in the elements array is also an array that contains the member and its score."
    }
  ],
  "examples": []
}
