BF.ADD

Syntax

  1. BF.ADD key item

Time complexity: O(1)

ACL categories: @bloom

Adds a single item to a Bloom filter key. If the key does not exist, a new Bloom filter is created with default parameters.

Return

Integer reply:

  • 1 if the item was successfully added to the filter.
  • 0 if the item was already added to the filter, which could be a false positive.

Examples

  1. dragonfly> BF.ADD bf Hello
  2. (integer) 1
  3. dragonfly> BF.ADD bf Hello
  4. (integer) 0

See also

BF.RESERVE | BF.MADD