Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Просмотр состояния базы данных (занятое дисковое место):

var collectionNames = db.getCollectionNames(),
  stats = [];
collectionNames.forEach(function (n) {
  stats.push(db[n].stats());
});

for (var c in stats) {
  if (!stats[c]["ns"]) continue;
  print(stats[c]["ns"].padEnd(40) + ": " + (''+stats[c]["count"]).padEnd(12) + (stats[c]["size"] / 1073741824).toFixed(3).padStart(8) + "GB" + (stats[c]["storageSize"] / 1073741824).toFixed(3).padStart(8) + "GB");
}

...