BF.ADD
Syntax
BF.ADD key item
- Available in:
- Redis Stack / Bloom 1.0.0
- Time complexity:
- O(k), where k is the number of hash functions used by the last sub-filter
向布隆过滤器中添加一个项目。
此命令类似于BF.MADD
,但只能添加一个项目。
必需的参数
item
是一个要添加的项目。
返回值
返回以下回复之一:
- Integer reply - 其中 "1" 表示项目已成功添加,而 "0" 表示该项目已添加到过滤器中(这可能是错误的)
- [] 在出错时(无效的参数、错误的键类型等)以及当过滤器已满时
示例
redis> BF.ADD bf item1
(integer) 1
redis> BF.ADD bf item1
(integer) 0