Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. var collectionNames = db.getCollectionNames(), stats = [];
  2. collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
  3. stats = stats.sort(function(a, b) { return b['storageSize'] - a['storageSize']; });
  4. for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['storageSize']); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement