{
  "schema_version": 2,
  "id": "commands/bitroarop",
  "title": "BITROAROP",
  "url": "https://redis.io/docs/latest/commands/bitroarop/",
  "summary": "Performs a bitwise operation and stores a native bitmap result for replication and AOF replay.",
  "since": "8.12.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-11-23T06:19:08-08:00",
  "page_type": "content",
  "content_hash": "f116290e0d66bc39e5b93d9f55d1ad0ff837c32f7a2a551dbad6abb318bfa91a",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "`BITROAROP` is an internal command that preserves native bitmap results during\nreplication and append-only file (AOF) replay. Applications cannot call it\ndirectly."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>AND | OR | XOR | NOT | DIFF | DIFF1 | ANDOR | ONE</code></summary>\n\nThe bitwise operation, with the same meaning as in\n[`BITOP`](https://redis.io/docs/latest/commands/bitop).\n\n</details>\n\n<details open><summary><code>destkey</code></summary>\n\nThe destination key. The result overwrites its existing value and removes its\nexpiration.\n\n</details>\n\n<details open><summary><code>key [key ...]</code></summary>\n\nThe source bitmap keys. Sources can be strings, native bitmaps, or missing keys.\n`NOT` requires exactly one source; `DIFF`, `DIFF1`, and `ANDOR` require at least\ntwo. Other operations require at least one source.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": "Redis uses this command to replay a native bitmap result independently of the\nreceiving node's `bitmap-default-roaring` setting. Ordinary clients receive an\nunknown-command error and do not see it in `COMMAND INFO` or `COMMAND DOCS`.\n\nThe operation follows `BITOP` semantics, including zero-padding shorter inputs.\nA result with a nonzero logical byte length is stored as a native bitmap, even\nwhen all its bits are zero. If all inputs are missing or have zero logical\nlength, Redis deletes the destination key."
    },
    {
      "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\n[Integer reply](../../develop/reference/protocol-spec#integers): the logical size\nin bytes of the result, equal to the longest input. This is not the number of\nset bits or the compressed memory usage.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the logical size\nin bytes of the result, equal to the longest input. This is not the number of\nset bits or the compressed memory usage."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`BITOP`](https://redis.io/docs/latest/commands/bitop) | [`BITCONVERT`](https://redis.io/docs/latest/commands/bitconvert)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Roaring-compressed bitmaps](https://redis.io/docs/latest/develop/data-types/strings/bitmaps#roaring-compressed-bitmaps)"
    }
  ],
  "examples": []
}
