content/commands/bf.scandump.md
Begins an incremental save of the Bloom filter.
This command is useful for large Bloom filters that cannot fit into the [DUMP]({{< relref "/commands/dump" >}}) and [RESTORE]({{< relref "/commands/restore" >}}) model.
The first time this command is called, the value of iter should be 0.
This command returns successive (iter, data) pairs until (0, NULL) to indicate completion.
is key name for a Bloom filter to save.
</details> <details open><summary><code>iterator</code></summary>Iterator value; either 0 or the iterator from a previous invocation of this command
</details>{{< highlight bash >}} redis> BF.RESERVE bf 0.1 10 OK redis> BF.ADD bf item1
Python code: {{< highlight bash >}} chunks = [] iter = 0 while True: iter, data = BF.SCANDUMP(key, iter) if iter == 0: break else: chunks.append([iter, data])
for chunk in chunks: iter, data = chunk BF.LOADCHUNK(key, iter, data) {{< / highlight >}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="bf-scandump-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
The Iterator is passed as input to the next invocation of BF.SCANDUMP. If Iterator is 0, then it means iteration has completed.
The iterator-data pair should also be passed to [BF.LOADCHUNK]({{< relref "commands/bf.loadchunk/" >}}) when restoring the filter.
-tab-sep-
One of the following:
The Iterator is passed as input to the next invocation of BF.SCANDUMP. If Iterator is 0, then it means iteration has completed.
The iterator-data pair should also be passed to [BF.LOADCHUNK]({{< relref "commands/bf.loadchunk/" >}}) when restoring the filter.
{{< /multitabs >}}