{
  "id": "bf.add",
  "title": "BF.ADD",
  "url": "https://redis.io/docs/latest/commands/bf.add/",
  "summary": "Adds an item to a Bloom Filter",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-04-09T10:29:34-04:00",
  "page_type": "content",
  "content_hash": "5c82f671b2812500efdcfdb379766802e8ce5d9cf33a775516a0fe6d91d0da91",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Adds an item to a Bloom filter.\n\nThis command is similar to [`BF.MADD`](), except that only one item can be added."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nis key name for a Bloom filter to add the item to.\n\nIf `key` does not exist - a new Bloom filter is created with default error rate, capacity, and expansion (see [`BF.RESERVE`]()).\n</details>\n\n<details open><summary><code>item</code></summary>\n\nis an item to add.\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> BF.ADD bf item1\n(integer) 1\nredis> BF.ADD bf item1\n(integer) 0"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Supported</span><br /> | <span title=\"Supported\"><nobr>&#x2705; Flexible & Annual</nobr></span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Integer reply](): `1` for successfully adding an item, or `0` if there's a probability that the item was already added to the filter.\n* [Simple error reply]() in these cases: invalid arguments, wrong key type, or when the filter is full.\n\n**RESP3:**\n\nOne of the following:\n* [Boolean reply](): `true` for successfully adding an item, or `false` if there's a probability that the item was already added to the filter.\n* [Simple error reply]() in these cases: invalid arguments, wrong key type, or when the filter is full."
    }
  ],
  "examples": []
}
