--- acl_categories: - '@bloom' - '@read' - '@slow' arguments: - name: key type: key - name: item type: string categories: - docs - develop - stack - oss - rs - rc - oss - kubernetes - clients complexity: O(k), where k is the number of hash functions used by the last sub-filter description: Checks whether an item exists in a Bloom Filter group: bf hidden: false linkTitle: BF.EXISTS module: Bloom railroad_diagram: /images/railroad/bf.exists.svg since: 1.0.0 stack_path: docs/data-types/probabilistic summary: Checks whether an item exists in a Bloom Filter syntax_fmt: BF.EXISTS key item title: BF.EXISTS --- Determines whether a given item was added to a Bloom filter. This command is similar to [`BF.MEXISTS`](/content/commands/bf.mexists.md), 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-cli %}} redis> BF.ADD bf item1 (integer) 1 redis> BF.EXISTS bf item1 (integer) 1 redis> BF.EXISTS bf item2 (integer) 0 {{% /redis-cli %}} ## Redis Software and Redis Cloud compatibility | Redis
Software | Redis
Cloud | Notes | |:----------------------|:-----------------|:------| | ✅ Supported
| ✅ Flexible & Annual
✅ Free & Fixed | | ## Return information {{< multitabs id="bf-exists-return-info" tab1="RESP2" tab2="RESP3" >}} One of the following: * [Integer reply](/content/develop/reference/protocol-spec.md#integers), where a value of `1` means the item was probably already added to the filter. A value of `0` means the item was definitely not added, `key` does not exist, or `key` contains a value of the wrong type. * [Simple error reply](/content/develop/reference/protocol-spec.md#simple-errors) if invalid arguments are passed. -tab-sep- One of the following: * [Boolean reply](/content/develop/reference/protocol-spec.md#booleans), where a value of `true` means the item was probably already added to the filter. A value of `false` means the item was definitely not added, `key` does not exist, or `key` contains a value of the wrong type. * [Simple error reply](/content/develop/reference/protocol-spec.md#simple-errors) if invalid arguments are passed. {{< /multitabs >}}