I encountered a strange behavior of mongo and I would like to clarify it a bit... My request is simple as that: I would like to get a size of single document in collect
With mongodb 4.4 (upcoming), You can use bsonSize operator to get the document size.
db.test.aggregate([ { "$project": { "name": 1, "object_size": { "$bsonSize": "$$ROOT" } } } ])