BF.MEXISTS
Syntax
BF.MEXISTS 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.EXISTS
,不同之处在于可以检查多个项目。
必需的参数
key
是布隆过滤器的键名。
item...
要检查的一个或多个项目。
返回值
返回以下回复之一:
- Array reply 的 Integer reply - 其中 "1" 表示,有很大概率,
item
已经被添加到过滤器中,而 "0" 表示key
不存在或item
肯定没有被添加到过滤器中。 - [] 出错时(无效参数,错误的键类型等)
示例
redis> BF.MADD bf item1 item2
1) (integer) 1
2) (integer) 1
redis> BF.MEXISTS bf item1 item2 item3
1) (integer) 1
2) (integer) 1
3) (integer) 0