mongo
use collectionName
db.collectionName.stats()
function getCollectionTotalIndexSize(indexSizes) {
const total = 0;
Object.keys(indexSizes).forEach(key => console.log(key, indexSizes[key]/(1024*1024), total += indexSizes[key]/(1024*1024)));
console.log('Total index size', total) // in MB
return total;
}