Hello, I am not able to find out the real size of document stored in mongo collections. I googled, that document size may be obtained by two methods:
db.collection.stats() - where there is a line 'avgObjSize' that produce some "aggregated"(average) size view on the data. It simply represents average size of single document.
I have a really simple document with this structure:
ids: [id1, id2, id3..... id500000]
each id is constructed by 10 characters.
By simle computation, the overall size should be more than 5 MB.
But when I initiate the 'Object.bsonsize' command, it returns: 499.
Stats command returns 'size' = 10747888.
I am really confused. Is there any way how to reliable find out size of the particular document? Are my steps performed so far absolutely wrong?
Thank you for your support, any help will be appreciated.