- Reference >
- Database Commands >
- Sharding Commands >
- listShards
listShards¶
On this page
Definition¶
-
listShards¶ Returns a list of the configured shards.
listShardsis only available formongosinstances. You can only issuelistShardsagainst theadmindatabase.The command takes the following form:
Example¶
The following operation runs listShards against the
mongos admin database:
The following document is an example of the output from a
listShards command:
Output¶
listShards returns a document containing the following
fields:
A field named
shardswhich contains an array of documents, each describing one shard. Each document may contain the following fields:Field Description _idThe name of the shard. hostThe hostname of the shard. If the shard is a replica set, hostlists the hostname of each mongod instance in the replica set.drainingIf true, indicates that removeShard has been called for this shard and it is in the process of being drained. tagsA list of zones to which the shard belongs. maxSizeThe configured maximum storage size of the shard in megabytes. This includes all data files on the shard including the localandadmindatabases. If exceeded, this shard will not receive any more chunks.stateAn internal field used during the addShard sequence to ensure that all steps and configuration necessary to add the shard to the cluster are completed.