{
  "schema_version": 2,
  "id": "commands/cf.scandump",
  "title": "CF.SCANDUMP",
  "url": "https://redis.io/docs/latest/commands/cf.scandump/",
  "summary": "Begins an incremental save of the bloom filter",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:54+01:00",
  "page_type": "content",
  "content_hash": "29f8c9671e478ad6f31ea0c80f5830149055515d9d9ac85ade9f10d3ae7caba6",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Begins an incremental save of the cuckoo filter.\n\nThis command is useful for large cuckoo filters that cannot fit into the [`DUMP`](https://redis.io/docs/latest/commands/dump) and [`RESTORE`](https://redis.io/docs/latest/commands/restore) model.\n\nThe first time this command is called, the value of `iter` should be 0. \n\nThis command returns successive `(iter, data)` pairs until `(0, NULL)` indicates completion."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nis key name for a cuckoo filter to save.\n</details>\n\n<details open><summary><code>iterator</code></summary>\n\nIterator value; either 0 or the iterator from a previous invocation of this command\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> CF.RESERVE cf 8\nOK\nredis> CF.ADD cf item1\n(integer) 1\nredis> CF.SCANDUMP cf 0\n1) (integer) 1\n2) \"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x14\\x00\\x01\\x00\"\nredis> CF.SCANDUMP cf 1\n1) (integer) 9\n2) \"\\x00\\x00\\x00\\x00\\a\\x00\\x00\\x00\"\nredis> CF.SCANDUMP cf 9\n1) (integer) 0\n2) (nil) \nredis> DEL cf\n(integer) 1\nredis> CF.LOADCHUNK cf 1 \"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x04\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x14\\x00\\x01\\x00\"\nOK\nredis> CF.LOADCHUNK cf 9 \"\\x00\\x00\\x00\\x00\\a\\x00\\x00\\x00\"\nOK\nredis> CF.EXISTS cf item1\n(integer) 1\n\n\nPython code:\n\nchunks = []\niter = 0\nwhile True:\n    iter, data = CF.SCANDUMP(key, iter)\n    if iter == 0:\n        break\n    else:\n        chunks.append([iter, data])\n\n# Load it back\nfor chunk in chunks:\n    iter, data = chunk\n    CF.LOADCHUNK(key, iter, data)"
    },
    {
      "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; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays): a two-element array of an [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers) (_Iterator_) and a [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) (_Data_).\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, the key was not found, or the key is of the wrong type.\n\nThe Iterator is passed as input to the next invocation of `CF.SCANDUMP`. If _Iterator_ is 0, then it means iteration has completed.\n\nThe iterator-data pair should also be passed to [`CF.LOADCHUNK`](https://redis.io/docs/latest/commands/cf.loadchunk) when restoring the filter.\n\n**RESP3:**\n\nOne of the following:\n* [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays): a two-element array of an [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers) (_Iterator_) and a [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) (_Data_).\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, the key was not found, or the key is of the wrong type.\n\nThe Iterator is passed as input to the next invocation of `CF.SCANDUMP`. If _Iterator_ is 0, then it means iteration has completed.\n\nThe iterator-data pair should also be passed to [`CF.LOADCHUNK`](https://redis.io/docs/latest/commands/cf.loadchunk) when restoring the filter."
    }
  ],
  "examples": []
}
