{
  "schema_version": 2,
  "id": "commands/bf.madd",
  "title": "BF.MADD",
  "url": "https://redis.io/docs/latest/commands/bf.madd/",
  "summary": "Adds one or more items to a Bloom Filter. A filter will be created if it does not exist",
  "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": "e38a4d768ea6fbb6d01c328ae8f658edba2f65b5c431626042d1c1e73ce05562",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Adds one or more items to a Bloom filter.\n\nThis command is similar to [`BF.ADD`](https://redis.io/docs/latest/commands/bf.add), except that you can add more than one item.\n\nThis command is similar to [`BF.INSERT`](https://redis.io/docs/latest/commands/bf.insert), except that the error rate, capacity, and expansion cannot be specified."
    },
    {
      "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 items 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\nOne or more items to add.\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> BF.MADD bf item1 item2 item2\n1) (integer) 1\n2) (integer) 1\n3) (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\">&#x2705; Flexible & Annual</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* [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) where each element is either\n  * an [integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers), where `1` means that the item has been added successfully, and `0` means there's a probability that the item was already added to the filter.\n  * a [simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) when the item cannot be added because the filter is full.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, key not found, wrong key type, or when the filter is full.\n\n**RESP3:**\n\nOne of the following:\n* [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) where each element is either\n  * a [boolean reply](https://redis.io/docs/latest/develop/reference/protocol-spec#booleans), where `true` means that the item has been added successfully, and `false` means there's a probability that the item was already added to the filter.\n  * a [simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) when the item cannot be added because the filter is full.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) in these cases: invalid arguments, key not found, wrong key type, or when the filter is full."
    }
  ],
  "examples": []
}
