summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2018-01-29 18:30:42 -0500
committerBlake Oler <blake.oler@mongodb.com>2018-01-30 18:18:54 -0500
commit784e55320f72ab9b9ec8b4f766d4be0c1b5e4a5b (patch)
treec4ee9469e58769b73d1d19bbba5da7462542f368 /src/mongo
parent153610cb7439546ef8897a2f4eda05b7fb50af5c (diff)
downloadmongo-784e55320f72ab9b9ec8b4f766d4be0c1b5e4a5b.tar.gz
SERVER-22039 Fix printShardingSize command
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/shell/utils_sh.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/shell/utils_sh.js b/src/mongo/shell/utils_sh.js
index cfbb5b11456..b872da66a2c 100644
--- a/src/mongo/shell/utils_sh.js
+++ b/src/mongo/shell/utils_sh.js
@@ -763,9 +763,7 @@ function printShardingSizes(configDB) {
output(1, "sharding version: " + tojson(configDB.getCollection("version").findOne()));
output(1, "shards:");
- var shards = {};
configDB.shards.find().forEach(function(z) {
- shards[z._id] = new Mongo(z.host);
output(2, tojson(z));
});
@@ -780,8 +778,7 @@ function printShardingSizes(configDB) {
.forEach(function(coll) {
output(3, coll._id + " chunks:");
configDB.chunks.find({"ns": coll._id}).sort({min: 1}).forEach(function(chunk) {
- var mydb = shards[chunk.shard].getDB(db._id);
- var out = mydb.runCommand({
+ var out = saveDB.adminCommand({
dataSize: coll._id,
keyPattern: coll.key,
min: chunk.min,