From: https://stackoverflow.com/questions/7851563#37232484
A short JavaScript program (and a one-line version) to display the number of bytes used by the indices of each collection in a MongoDB database.
TODO: Use functions like each()
to loop over the arrays, making it execute faster and the code shorter.