Docs Menu

Docs HomeMongoDB 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 →
Share Feedback
© 2023 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.