{
  "id": "cf.add",
  "title": "CF.ADD",
  "url": "https://redis.io/docs/latest/commands/cf.add/",
  "summary": "Adds an item to a Cuckoo 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": "fc51c7c3ac3f604db83bde78fdf21ada5859b95760275e790cca6a95c43e7302",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Adds an item to the cuckoo filter.\n\nCuckoo filters can contain the same item multiple times, and consider each addition as separate.\nUse [`CF.ADDNX`]() to add an item only if it does not exist."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nis key name for a cuckoo filter to add the item to.\n\nIf `key` does not exist - a new cuckoo filter is created.\n</details>\n\n<details open><summary><code>item</code></summary>\n\nis an item to add.\n</details>"
    },
    {
      "id": "complexity",
      "title": "Complexity",
      "role": "performance",
      "text": "O(n + i), where n is the number of `sub-filters` and i is `maxIterations`.\nAdding items requires up to 2 memory accesses per `sub-filter`.\nBut as the filter fills up, both locations for an item might be full.\nThe filter attempts to `Cuckoo` swap items up to `maxIterations` times."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> CF.ADD cf item1\n(integer) 1\nredis> CF.ADD cf item1\n(integer) 1"
    },
    {
      "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 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 to the filter.\n* [Simple error reply]() in these cases: invalid arguments, wrong key type, or when the filter is full."
    }
  ],
  "examples": []
}
