BF.SCANDUMP
BF.SCANDUMP key iterator
- Group
- Bloom filter
- Complexity
- O(n), n being the bytes of the chunk returned
- Arity
- -1 (at least 1 words, counting the command name)
- Flags
- none
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
BF.SCANDUMP returns the Bloom filter at key one chunk at a time, so you
can store it outside HotKV or copy it to another key or server with
BF.LOADCHUNK.
Start with iterator 0. Each reply gives the next iterator and a chunk of
binary data. Pass the iterator back to get the next chunk, and keep every
(iterator, data) pair. The dump is complete when the reply’s iterator is 0
(with empty data). The first chunk describes the filter; the others hold its
bits.
Do not change the filter while you dump it, or the chunks will not match.
Return value
Section titled “Return value”An array of two elements, the same in RESP2 and RESP3:
| Element | Value |
|---|---|
| 1 | Integer: the iterator for the next call, or 0 when the dump is complete |
| 2 | Bulk string: the chunk’s binary data (empty at the end) |
Error replies: ERR not found when the key does not exist,
Second argument must be numeric for a non-integer iterator, and
WRONGTYPE.
Examples
Section titled “Examples”Keep passing back the iterator from the previous reply. The call that returns
iterator 0 with empty data ends the dump:
127.0.0.1:6379> BF.ADD visitors alice(integer) 1127.0.0.1:6379> BF.SCANDUMP visitors 1451) (integer) 02) ""127.0.0.1:6379> BF.SCANDUMP nosuchfilter 0(error) ERR not foundCompatibility
Section titled “Compatibility”Same command flow as BF.SCANDUMP in RedisBloom. The chunk format is HotKV’s
own: load HotKV dumps into HotKV, not into RedisBloom, and the other way
around.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.