1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Fix megabyte symbol, should be MB

This commit is contained in:
jbranchaud
2020-06-06 13:02:02 -05:00
parent ab18922c57
commit c87a6ec2ad

View File

@@ -10,11 +10,11 @@ size metrics for all of our database's collections:
```javascript
> db.getCollectionNames().forEach(function (collectionName) {
sizeInMb = db[collectionName].stats({ scale: 1024 * 1024 }).size;
print(collectionName + ": " + sizeInMb + "Mb");
print(collectionName + ": " + sizeInMb + "MB");
})
books: 10Mb
authors: 2Mb
genres: 1Mb
books: 10MB
authors: 2MB
genres: 1MB
```
This snippet gets all the collections for the current database and iterates