{
  "id": "blmovem",
  "title": "BLMOVEM",
  "url": "https://redis.io/docs/latest/commands/blmovem/",
  "summary": "Moves up to (or exactly) a number of elements from one list to another and returns them. Blocks until the elements are available otherwise. Deletes the source list if it becomes empty.",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-07-30T08:54:30-07:00",
  "page_type": "content",
  "content_hash": "0dddd127bc07e67669c8ae62afb2d26537de224ab9b7a7b95b2ab15e7a384b61",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "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\n`BLMOVEM` is the blocking variant of [`LMOVEM`](https://redis.io/docs/latest/commands/lmovem).\nWhen `source` holds enough elements to satisfy the request, this command behaves\nexactly like [`LMOVEM`](https://redis.io/docs/latest/commands/lmovem). Otherwise, Redis blocks the connection until\nanother client pushes the required elements to `source` or until `timeout` is\nreached."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>source</code></summary>\n\nThe key of the source list.\n\n</details>\n\n<details open><summary><code>destination</code></summary>\n\nThe key of the destination list.\n\n</details>\n\n<details open><summary><code>LEFT | RIGHT</code></summary>\n\nThe end of `source` to pop elements from: `LEFT` (head) or `RIGHT` (tail).\n\n</details>\n\n<details open><summary><code>LEFT | RIGHT</code></summary>\n\nThe end of `destination` to push elements to: `LEFT` (head) or `RIGHT` (tail).\n\n</details>\n\n<details open><summary><code>timeout</code></summary>\n\nThe maximum time to block, in seconds. A timeout of `0` blocks indefinitely.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "The `how-many` block controls how many elements are moved and in what order.\nWhen you include it, you must provide both a selector (`COUNT` or `EXACTLY`)\nand an ordering (`OBO` or `BULK`).\n\n<details open><summary><code>COUNT count | EXACTLY exactly</code></summary>\n\nThe number of elements to move:\n\n- `COUNT count` moves up to `count` elements. If `source` holds fewer than\n  `count` elements, all of them are moved. This matches the `count` semantics of\n  [`LPOP`](https://redis.io/docs/latest/commands/lpop) and [`LMPOP`](https://redis.io/docs/latest/commands/lmpop).\n- `EXACTLY exactly` moves exactly `exactly` elements. If `source` holds fewer\n  than `exactly` elements, the command blocks (see [Blocking behavior](#blocking-behavior)).\n\n</details>\n\n<details open><summary><code>OBO | BULK</code></summary>\n\nThe order in which elements are pushed onto `destination`:\n\n- `OBO` (one by one) moves elements individually: each element is popped from\n  `source` and pushed to `destination` before the next one is moved.\n- `BULK` moves all of the elements at once, preserving their relative order.\n\nSee the [Element ordering](https://redis.io/docs/latest/commands/lmovem#element-ordering) section of the [`LMOVEM`](https://redis.io/docs/latest/commands/lmovem) documentation for details.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "blocking-behavior",
      "title": "Blocking behavior",
      "role": "content",
      "text": "Whether `BLMOVEM` blocks depends on the selector:\n\n- With `COUNT`, the command blocks only while `source` is empty. As soon as at\n  least one element is available it unblocks, moves up to `count` elements, and\n  returns them.\n- With `EXACTLY`, the command blocks while `source` holds fewer than the\n  requested number of elements. It unblocks only once `source` grows to at least\n  that length, then moves exactly that many elements atomically.\n\nA `timeout` of `0` blocks indefinitely. When used inside a\n[`MULTI`](https://redis.io/docs/latest/commands/multi)/[`EXEC`](https://redis.io/docs/latest/commands/exec) block or a Lua script, `BLMOVEM` does not block; it\nbehaves like [`LMOVEM`](https://redis.io/docs/latest/commands/lmovem) and, when the request cannot be satisfied,\nreturns nil immediately."
    },
    {
      "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=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Array reply](../../develop/reference/protocol-spec#arrays): the moved elements, in destination order.\n* [Nil reply](../../develop/reference/protocol-spec#bulk-strings): the operation timed out.\n\n**RESP3:**\n\nOne of the following:\n* [Array reply](../../develop/reference/protocol-spec#arrays): the moved elements, in destination order.\n* [Null reply](../../develop/reference/protocol-spec#nulls): the operation timed out."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`BLMOVE`](https://redis.io/docs/latest/commands/blmove/) | [`LMOVEM`](https://redis.io/docs/latest/commands/lmovem/) | [`BLMPOP`](https://redis.io/docs/latest/commands/blmpop/) | [`BRPOPLPUSH`](https://redis.io/docs/latest/commands/brpoplpush/)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Redis lists](https://redis.io/docs/latest/develop/data-types/lists)"
    }
  ],
  "examples": []
}
