In MongoDB, when we pass field names as the second parameter for find query does mongodb load whole document in memory or only the memory associated with those fields ?
On the MongoDB server side, the whole document is stored in one place on disk. Because MongoDB use memory mapped files, any document access requires that whole document to be loaded in memory. After the query has run, only the requested fields are transferred to the client. This means that on the client/driver side, only the requested fields are stored in memory, and not the whole document
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With