14 / 15

How to find a shard key?

Every shared collection has a shard key.

  1. 1

    connect to a mongos instance and run the db.printShardingStatus() method

  2. 2

    connect to a mongos instance and run the sh.status()