CF.EXISTS

Syntax
CF.EXISTS key item
Available in:
Redis Stack / Bloom 1.0.0
Time complexity:
O(k), where k is the number of sub-filters

确定给定项目是否已添加到布谷鸟过滤器中。

此命令类似于CF.MEXISTS,不同之处在于只能检查一个项目。

必需的参数

key

是布谷鸟过滤器的键名。

item

是一个需要检查的项目。

返回值

返回以下回复之一:

  • Integer reply,其中 1 表示很有可能 item 已经被添加到过滤器中,而 0 表示 key 不存在或 item 尚未被添加到过滤器中。请参阅 CF.DEL 中的说明。
  • [] 出错时(无效参数、错误的键类型等)

示例

redis> CF.ADD cf item1
(integer) 1
redis> CF.EXISTS cf item1
(integer) 1
redis> CF.EXISTS cf item2
(integer) 0

RATE THIS PAGE
Back to top ↑