Data Storage and Impact on Performance

Friends, I have been trying to find out a good article or KB which helps us understand the amount of bytes used to store each of data types in Mongo DB. For example, someone may store a monetary value in string or double data type some may storage as integer and the decimal is handled in the UI. (example, stored as 1199 but application shows it as 11.99)

Basically, in general, how do we calculate the storage of a document using various data types in Mongo DB is the main ask. The thought is with regards to the storage and the performance related to it.

Any guidance will be great help.


the $bsonSize operator should do the job:

Thanks @Joe_Drumgoole , I will check. Hopefully, this should help to see how much storage is taken from data type perspective.