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

Determines whether a given item was added to a cuckoo filter.

This command is similar to CF.MEXISTS, except that only one item can be checked.

Required arguments

key

is key name for a cuckoo filter.

item

is an item to check.

Return value

Returns one of these replies:

  • Integer reply, where 1 means that, with high probability, item had already been added to the filter, and 0 means that key does not exist or that item had not been added to the filter. See note in CF.DEL.
  • [] on error (invalid arguments, wrong key type, and so on)

Examples

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 ↑