View Cluster Configuration
To list the databases that have sharding enabled, query the
databases collection in the Config Database. A database has sharding enabled if the value of the
partitioned field is
true. Connect to a
mongos instance with a
mongo shell, and run the following operation to get a full list of databases with sharding enabled:
You can use the following sequence of commands to return a list of all databases in the cluster:
If this returns the following result set:
Then sharding is only enabled for the
To list the current set of configured shards, use the
listShards command, as follows:
In the following example output from
sharding versiondisplays the version number of the shard metadata.
shardsdisplays a list of the
mongodinstances used as shards in the cluster.
databasesdisplays all databases in the cluster, including database that do not have sharding enabled.
chunksinformation for the
foodatabase displays how many chunks are on each shard and displays the range of each chunk.