BF.ADD

Usage:
BF.ADD key value
Complexity:
O(N), where N is the number of hash functions used by the bloom filter.
Module:
valkey-bloom
Since module version:
1.0.0

Adds a single item to a bloom filter. If the specified bloom filter does not exist, a bloom filter is created with the provided name with default properties.

To add multiple items to a bloom filter, you can use the BF.MADD or BF.INSERT commands.

To create a bloom filter with non-default properties, use the BF.INSERT or BF.RESERVE command.

Examples

127.0.0.1:6379> BF.ADD key val
(integer) 1
127.0.0.1:6379> BF.ADD key val
(integer) 0

RESP2/RESP3 Reply

One of the following:

An error will occur if input is invalid, if a non bloom filter key with the same name already exists, if the bloom filter creation / scale out exceeds limits, or if an item is being added to a full non scaling filter.