This might be a dummy question, but I cannot find any clue in all online doc.
For a already-built-up mongodb cluster, How can I find which sharding key(s) is used for given collecton?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As outlined in the Sharding Administration Docs, you can use
db.printShardingStatus()to see this information.For sharded collections it will print the key pattern.