BF.MADD
Syntax
BF.MADD key item [item ...]
- Available in:
- Redis Stack / Bloom 1.0.0
- Time complexity:
- O(k * n), where k is the number of hash functions and n is the number of items
向布隆过滤器中添加一个或多个项目。
此命令类似于BF.ADD
,不同之处在于您可以添加多个项目。
此命令类似于BF.INSERT
,但无法指定错误率、容量和扩展。
必需的参数
item...
要添加的一个或多个项目。
返回值
返回以下回复之一:
- Array reply 其中每个元素是
- Integer reply - 其中 "1" 表示项目已成功添加,"0" 表示该项目已添加到过滤器中(可能是错误的)
- [] 当项目无法添加时,因为过滤器已满
- [] 出错时(无效参数,错误的键类型等)
示例
redis> BF.MADD bf item1 item2 item2
1) (integer) 1
2) (integer) 1
3) (integer) 0