Docs Menu

Docs HomeDevelop ApplicationsMongoDB Manual

Find a Shard Key

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().

←  Set Missing Shard Key FieldsTroubleshoot Shard Keys →