BF.EXISTS 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
Determines whether a given item was added to a Bloom filter.
This command is similar to
BF.MEXISTS, except that only one item can be checked.
is key name for a Bloom filter.
is an item to check.
Returns one of these replies:
- Integer reply, where
1means that, with high probability,
itemwas already added to the filter, and
keydoes not exist or that
itemhad not been added to the filter.
- Error reply on error (invalid arguments, wrong key type, etc.)
redis> BF.ADD bf item1 (integer) 1 redis> BF.EXISTS bf item1 (integer) 1 redis> BF.EXISTS bf item2 (integer) 0