content/commands/bf.add.md
Adds an item to a Bloom filter.
This command is similar to [BF.MADD]({{< relref "commands/bf.madd/" >}}), except that only one item can be added.
is key name for a Bloom filter to add the item to.
If key does not exist - a new Bloom filter is created with default error rate, capacity, and expansion (see [BF.RESERVE]({{< relref "commands/bf.reserve/" >}})).
is an item to add.
</details>{{< highlight bash >}} redis> BF.ADD bf item1 (integer) 1 redis> BF.ADD bf item1 (integer) 0 {{< / highlight >}}
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported"><nobr>✅ Flexible & Annual</nobr></span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="bf-add-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
1 for successfully adding an item, or 0 if there's a probability that the item was already added to the filter.-tab-sep-
One of the following:
true for successfully adding an item, or false if there's a probability that the item was already added to the filter.{{< /multitabs >}}