{
  "schema_version": 2,
  "id": "commands/bless-scan",
  "title": "BLESS SCAN",
  "url": "https://redis.io/docs/latest/commands/bless-scan/",
  "summary": "Incrementally iterates the blessed keys of the current database that carry the given flag.",
  "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": "f829f329f19c717e3acdd345097788d05fea5514e2cf6f3582feaade7ab45818",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "`BLESS SCAN` incrementally iterates the blessed keys of the current database that carry the given protection flag, using the same cursor-based protocol as [`SCAN`](https://redis.io/docs/latest/commands/scan)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>cursor</code></summary>\n\nThe cursor value. Start an iteration with `0`, then use the cursor returned by each call as the argument to the next call.\n\n</details>\n\n<details open><summary><code>NO-EVICT</code></summary>\n\nThe protection flag to filter by. `NO-EVICT` is currently the only supported flag, and this argument is required.\n\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>COUNT count</code></summary>\n\nA hint for the number of keys to visit per iteration. The default is 1024.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": "`BLESS SCAN` follows the same cursor semantics and iteration guarantees as [`SCAN`](https://redis.io/docs/latest/commands/scan): a full iteration, from cursor `0` until the returned cursor is `0` again, is guaranteed to return every key that carried the given flag for the entire duration of the iteration. `COUNT` is only a hint, and a key may be returned more than once during a full iteration."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> SET session:42 \"some value\"\nOK\nredis> SET cache:100 \"some value\"\nOK\nredis> BLESS SET session:42 NO-EVICT\n(integer) 1\nredis> BLESS SET cache:100 NO-EVICT\n(integer) 1\nredis> BLESS SCAN 0 NO-EVICT\n1) \"0\"\n2) 1) \"cache:100\"\n   2) \"session:42\""
    },
    {
      "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[Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays): specifically, an array with two elements.\n* The first element is a [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) that represents an unsigned 64-bit number, the cursor.\n* The second element is an [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) with the names of the scanned keys.\n\n**RESP3:**\n\n[Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays): specifically, an array with two elements.\n* The first element is a [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) that represents an unsigned 64-bit number, the cursor.\n* The second element is an [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) with the names of the scanned keys."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`BLESS SET`](https://redis.io/docs/latest/commands/bless-set) | [`BLESS CLEAR`](https://redis.io/docs/latest/commands/bless-clear) | [`BLESS GET`](https://redis.io/docs/latest/commands/bless-get)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Key eviction](https://redis.io/docs/latest/develop/reference/eviction)"
    }
  ],
  "examples": []
}
