{
  "schema_version": 2,
  "id": "commands/pubsub-numpat",
  "title": "PUBSUB NUMPAT",
  "url": "https://redis.io/docs/latest/commands/pubsub-numpat/",
  "summary": "Returns a count of unique pattern subscriptions.",
  "since": "2.8.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:25+01:00",
  "page_type": "content",
  "content_hash": "03d174afe48b38811156bea55e89add443a652a8cdbf3c28394073bcbb6b3c2b",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Returns the number of unique patterns that are subscribed to by clients (that are performed using the [`PSUBSCRIBE`](https://redis.io/docs/latest/commands/psubscribe) command).\n\nNote that this isn't the count of clients subscribed to patterns, but the total number of unique patterns all the clients are subscribed to.\n\nCluster note: in a Redis Cluster clients can subscribe to every node, and can also publish to every other node. The cluster will make sure that published messages are forwarded as needed. That said, [`PUBSUB`](https://redis.io/docs/latest/commands/pubsub)'s replies in a cluster only report information from the node's Pub/Sub context, rather than the entire cluster."
    },
    {
      "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; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of patterns all the clients are subscribed to.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of patterns all the clients are subscribed to."
    }
  ],
  "examples": []
}
