Find a Shard Key
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of MongoDB server.
To find the shard key of an existing sharded collection, use the
db.printShardingStatus()
method:
db.printShardingStatus()
For details on the db.printShardingStatus()
output, see
sh.status()
.