Module Hub Beta
SBF.ADDkey elem id [elem id ...]
Adds one or more elements and their ids to the filter in
key doesn’t exist, the filter is created with the default capacity (100000) and error rate (0.05).
ids are always integers, but can be provided in one of the following ways:
- An unsigned integer ‘n’ means the literal numeric id ‘n’.
- ‘+[n]’ means incrementing the filter’s current maximum id by ‘n’ and using that value. By default ‘n’ is 1, so you can simply use the ‘+’ sign for the default increment. You can use ‘+0’ to use the current maximum id without incrementing it.
- ‘/[n]’ means the server’s clock in milliseconds, divided by ‘n’, floored and multiplied by ‘n’. By default ‘n’ is 1. This is useful for generating ids based on resolutions other than milliseconds, e.g. ‘/1000’ will provide second resolutions ids, ‘/60000’ is for minute resolution, etc.
Notes about adding multiple elements in a single call:
- The clock is sampled once per call.
- max_id may may be updated once, otherwise an error is returned.
Integer reply: the filter’s current maximum id.
redis> SBF.ADD bloom foo +0
redis> SBF.ADD bloom bar +0
redis> SBF.CHECK bloom foo
redis> SBF.CHECK bloom bar
redis> SBF.CHECK bloom baz