BF.EXISTS
Syntax
BF.EXISTS key item
- Available in:
- Redis Open Source / Bloom 1.0.0
- Time complexity:
- O(k), where k is the number of hash functions used by the last sub-filter
- ACL categories:
-
@bloom,@read,@slow, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
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.
Required arguments
key
is key name for a Bloom filter.
item
is an item to check.
Examples
redis> BF.ADD bf item1
(integer) 1
redis> BF.EXISTS bf item1
(integer) 1
redis> BF.EXISTS bf item2
(integer) 0Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Supported |
✅ Flexible & Annual ✅ Free & Fixed |
Return information
One of the following:
- Integer reply:
1means that, with high probability,itemwas already added to the filter, and0means that either thekeydoes not exist or that theitemhad not been added to the filter. - Simple error reply if invalid arguments are passed.