MongoDB uses BSON to store objects so the calculated size will need to depend on BSON. Take a look at https://www.npmjs.com/package/bson:
import bson from 'bson'
const BSON = new bson.BSONPure.BSON()
BSON.calculateObjectSize({foo: 'bar'}) // => 18 bytes
This value will be close but still approximate since Mongo uses further optimizations.