mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Fix megabyte symbol, should be MB
This commit is contained in:
@@ -10,11 +10,11 @@ size metrics for all of our database's collections:
|
|||||||
```javascript
|
```javascript
|
||||||
> db.getCollectionNames().forEach(function (collectionName) {
|
> db.getCollectionNames().forEach(function (collectionName) {
|
||||||
sizeInMb = db[collectionName].stats({ scale: 1024 * 1024 }).size;
|
sizeInMb = db[collectionName].stats({ scale: 1024 * 1024 }).size;
|
||||||
print(collectionName + ": " + sizeInMb + "Mb");
|
print(collectionName + ": " + sizeInMb + "MB");
|
||||||
})
|
})
|
||||||
books: 10Mb
|
books: 10MB
|
||||||
authors: 2Mb
|
authors: 2MB
|
||||||
genres: 1Mb
|
genres: 1MB
|
||||||
```
|
```
|
||||||
|
|
||||||
This snippet gets all the collections for the current database and iterates
|
This snippet gets all the collections for the current database and iterates
|
||||||
|
|||||||
Reference in New Issue
Block a user