Skip to content

Instantly share code, notes, and snippets.

@zizkebab
Created May 28, 2018 06:55
Show Gist options
  • Select an option

  • Save zizkebab/93b920fb05a2e36010a0c79b979db9b3 to your computer and use it in GitHub Desktop.

Select an option

Save zizkebab/93b920fb05a2e36010a0c79b979db9b3 to your computer and use it in GitHub Desktop.

Revisions

  1. zizkebab created this gist May 28, 2018.
    2 changes: 2 additions & 0 deletions print_sizes.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    use mydb
    db.getCollectionNames().forEach(function(x){print(x + ": " + db.getCollection(x).totalIndexSize()/(1024*1024*1024) + ", " + db.getCollection(x).dataSize()/(1024*1024*1024) + ", " + db.getCollection(x).totalSize()/(1024*1024*1024))})