# PUBSUB SHARDCHANNELS

> List the shard channels that currently have subscribers.

URL: https://docs.hotkv.com/commands/pubsub-shardchannels/

```
PUBSUB SHARDCHANNELS [pattern]
```

- Group: Pub/Sub
- Complexity: O(N) where N is the number of active shard channels
- HotKV Cloud: all plans
- On-Premise: no license needed

`PUBSUB SHARDCHANNELS` returns the shard channels on this node that have at
least one [SSUBSCRIBE](https://docs.hotkv.com/commands/ssubscribe/index.md) subscriber. With `pattern`,
only shard channels matching that glob pattern are returned. In a cluster,
each node reports only the shard channels of the slots it serves.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Array of bulk strings (empty when there are none) | Array |

More than one pattern is an error:
`ERR unknown subcommand or wrong number of arguments for 'SHARDCHANNELS'. Try PUBSUB HELP.`

## Examples

```
127.0.0.1:6379> PUBSUB SHARDCHANNELS
1) "orders:{eu}"
127.0.0.1:6379> PUBSUB SHARDCHANNELS orders:*
1) "orders:{eu}"
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[PUBSUB SHARDNUMSUB](https://docs.hotkv.com/commands/pubsub-shardnumsub/index.md),
[SSUBSCRIBE](https://docs.hotkv.com/commands/ssubscribe/index.md), [PUBSUB](https://docs.hotkv.com/commands/pubsub/index.md)