【发布时间】:2020-05-14 13:18:49
【问题描述】:
出于调查目的,我需要获取给定 MongoDB 集合的 shardkey。
db.getSiblingDB("mydb").mycollection.getIndexes() 给出所有索引。
db.getSiblingDB("mydb").mycollection.getShardDistribution() 给出了分片之间的分布。
获取分片键的命令是什么?
【问题讨论】:
标签: mongodb sharding mongo-shell