{
  "id": "cms.query",
  "title": "CMS.QUERY",
  "url": "https://redis.io/docs/latest/commands/cms.query/",
  "summary": "Returns the count for one or more items in a sketch",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-04-09T10:29:34-04:00",
  "page_type": "content",
  "content_hash": "1d15cf588bda2890fdc1fc4614bc30a2d7e529f2350ea4055a0bfdd33305d227",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns the count for one or more items in a sketch."
    },
    {
      "id": "parameters",
      "title": "Parameters:",
      "role": "parameters",
      "text": "* **key**: The name of the sketch.\n* **item**: One or more items for which to return the count."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "[code example]"
    },
    {
      "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\n* [Array]() of [integer replies]()  representing the min-counts of each of the provided items in the sketch.\n* [Simple error reply]() in these cases: invalid arguments, missing key, or wrong key type.\n\n**RESP3:**\n\nOne of the following:\n\n* [Array]() of [integer replies]() representing the min-counts of each of the provided items in the sketch.\n* [Simple error reply]() in these cases: invalid arguments, missing key, or wrong key type."
    }
  ],
  "examples": [
    {
      "id": "examples-ex0",
      "language": "plaintext",
      "code": "redis> CMS.QUERY test foo bar\n1) (integer) 10\n2) (integer) 42",
      "section_id": "examples"
    }
  ]
}
