BF.MADD
BF.MADD key item [item ...]
- Group
- Bloom filter
- Complexity
- O(k * n), k hash functions and n items
- 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.MADD adds each item to the Bloom filter at key, in order, and reports
for each one whether it was new. If the key does not exist, a filter is
created first with capacity 100, error rate 0.01 and expansion 2.
Return value
Section titled “Return value”An array with one element per item:
| Element | RESP2 | RESP3 |
|---|---|---|
| Item added | Integer 1 |
Boolean true |
| Item (probably) already present | Integer 0 |
Boolean false |
If an item cannot be added (a full non-scaling filter, or no memory to grow),
the array ends with that error in place of the item’s reply, and the items
after it are not tried. For example a non-scaling filter that fills up
mid-call replies with 1 for the items that fit and then
ERR non scaling filter is full.
WRONGTYPE if the key holds another type (as the whole reply).
Examples
Section titled “Examples”127.0.0.1:6379> BF.MADD tags red green red1) (integer) 12) (integer) 13) (integer) 0127.0.0.1:6379> BF.RESERVE tiny 0.000001 2 NONSCALINGOK127.0.0.1:6379> BF.MADD tiny a b c d1) (integer) 12) (integer) 13) (error) ERR non scaling filter is fullCompatibility
Section titled “Compatibility”Same as BF.MADD in RedisBloom.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.