- Reference >
mongo
Shell Methods >- Collection Methods >
- db.collection.getShardDistribution()
db.collection.getShardDistribution()¶
On this page
Definition¶
-
db.collection.
getShardDistribution
()¶ Returns: Prints the data distribution statistics for a sharded collection. You must call the getShardDistribution()
method on a sharded collection, as in the following example:In the following example, the collection has two shards. The output displays both the individual shard distribution information as well the total shard distribution:
See also
Output¶
The output information displays:
<shard-x>
is a string that holds the shard name.<host-x>
is a string that holds the host name(s).<size-x>
is a number that includes the size of the data, including the unit of measure (e.g.b
,Mb
).<count-x>
is a number that reports the number of documents in the shard.<number of chunks-x>
is a number that reports the number of chunks in the shard.<size-x>/<number of chunks-x>
is a calculated value that reflects the estimated data size per chunk for the shard, including the unit of measure (e.g.b
,Mb
).<count-x>/<number of chunks-x>
is a calculated value that reflects the estimated number of documents per chunk for the shard.<stats.size>
is a value that reports the total size of the data in the sharded collection, including the unit of measure.<stats.count>
is a value that reports the total number of documents in the sharded collection.<calc total chunks>
is a calculated number that reports the number of chunks from all shards, for example:<estDataPercent-x>
is a calculated value that reflects, for each shard, the data size as the percentage of the collection’s total data size, for example:<estDocPercent-x>
is a calculated value that reflects, for each shard, the number of documents as the percentage of the total number of documents for the collection, for example:stats.shards[ <shard-x> ].avgObjSize
is a number that reflects the average object size, including the unit of measure, for the shard.
Example Output¶
For example, the following is a sample output for the distribution of a sharded collection: