# BF.EXISTS

> Check whether an item may have been added to a Bloom filter.

URL: https://docs.hotkv.com/commands/bf-exists/

```
BF.EXISTS key item
```

- Group: Bloom filter
- Complexity: O(k), k being the number of hash functions
- HotKV Cloud: all plans
- On-Premise: no license needed

`BF.EXISTS` tells you whether `item` may be in the Bloom filter at `key`. A
`0` is certain: the item was never added. A `1` means it was probably added;
the chance of a wrong `1` is about the filter's error rate.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Item may be present | Integer `1` | Boolean true |
| Item not present | Integer `0` | Boolean false |
| Key does not exist | Integer `0` | Boolean false |

A key that holds another type also replies `0`, not `WRONGTYPE`.

## Examples

```
127.0.0.1:6379> BF.ADD visitors alice
(integer) 1
127.0.0.1:6379> BF.EXISTS visitors alice
(integer) 1
127.0.0.1:6379> BF.EXISTS visitors bob
(integer) 0
127.0.0.1:6379> BF.EXISTS nosuchfilter alice
(integer) 0
```

## Compatibility

Same as `BF.EXISTS` in RedisBloom for Bloom filter keys and missing keys.

## See also

[BF.MEXISTS](https://docs.hotkv.com/commands/bf-mexists/index.md), [BF.ADD](https://docs.hotkv.com/commands/bf-add/index.md), [BF.CARD](https://docs.hotkv.com/commands/bf-card/index.md)