Sum of Sizes of All MongDB Databases

Hello,

You could try to use just the below command.

db.adminCommand("listDatabases").totalSizeMb;

This should return the sum of all the sizeOnDisk fields, expressed in megabytes. as per this documentation link.

Regards,
Mohamed Elshafey

1 Like