Open your terminal then open Mongo Shell

mongo

Select your database

use myDbName

Now paste the following code:

// Get collection names
var collectionNames = db.getCollectionNames()
var col_stats = [];

// Get stats for every collections
collectionNames.forEach(function (n) { 
    col_stats.push(db.getCollection(n).stats());
});

// Print
for (var item of col_stats) {
    print(`${item['ns']} | size: ${item['size']} 
(${(item['size']/1073741824).toFixed(2)} GB) | storageSize: ${item['storageSize']} 
(${(item['storageSize']/1073741824).toFixed(2)} GB)`);
}

Reference: https://stackoverflow.com/a/61733956/3380387

mongo series1 - Run MongoDB in the background2 - Create root user in MongoDB3 - Default Config File Path4 - Create Daily Backup For MongoDB Databases5 - Default path of config file in MongoDB6 - List All Databases In MongoDB7 - Delete OR Drop Database In MongoDB8 - How to export or dump database in MongoDB9 - How Import or restore database In MongoDB10 - List all collections in database with its size11 - Delete Database Collection from database12 - Delete Database Collection documents from database
MONGODB#MONGODBterminal#terminal