var collectionNames = db.getCollectionNames(), stats = []; collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); stats = stats.sort(function(a, b) { return b['storageSize'] - a['storageSize']; }); for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['storageSize']); }