{
  "schema_version": 2,
  "id": "commands/bf.add",
  "title": "BF.ADD",
  "url": "https://redis.io/docs/latest/commands/bf.add/",
  "summary": "Adds an item to a Bloom Filter",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:54+01:00",
  "page_type": "content",
  "content_hash": "879ec9b3840efa09d1694b2c091680bbd1e300f16c78a3928713a9572e57ed7a",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Adds an item to a Bloom filter.\n\nThis command is similar to [`BF.MADD`](https://redis.io/docs/latest/commands/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`](https://redis.io/docs/latest/commands/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](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `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](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) 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](https://redis.io/docs/latest/develop/reference/protocol-spec#booleans): `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](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, wrong key type, or when the filter is full."
    }
  ],
  "examples": []
}
