Back to Redis

BF.MEXISTS

content/commands/bf.mexists.md

latest2.2 KB
Original Source

Determines whether one or more items were added to a Bloom filter.

This command is similar to [BF.EXISTS]({{< relref "commands/bf.exists/" >}}), except that more than one item can be checked.

Required arguments

<details open><summary><code>key</code></summary>

is key name for a Bloom filter.

</details> <details open><summary><code>item...</code></summary>

One or more items to check.

</details>

Examples

{{< highlight bash >}} redis> BF.MADD bf item1 item2

  1. (integer) 1
  2. (integer) 1 redis> BF.MEXISTS bf item1 item2 item3
  3. (integer) 1
  4. (integer) 1
  5. (integer) 0 {{< / highlight >}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | |

Return information

{{< multitabs id="bf-mexists-return-info" tab1="RESP2" tab2="RESP3" >}}

One of the following:

  • [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [integer replies]({{< relref "/develop/reference/protocol-spec#integers" >}}), where 1 means that, with high probability, item was already added to the filter, and 0 means that key does not exist or that item was definitely not added to the filter.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: in these cases: invalid arguments, wrong key type, or when the key was not found.

-tab-sep-

One of the following:

  • [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) of [boolean replies]({{< relref "/develop/reference/protocol-spec#booleans" >}}), where true means that, with high probability, item was already added to the filter, and false means that key does not exist or that item was definitely not added to the filter.
  • [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}) in these cases: in these cases: invalid arguments, wrong key type, or when the key was not found.

{{< /multitabs >}}