I have a domain
collection with documents that contain domain information. Some of them are historical whois records, which can be zero or more and, of course, occupy most of the space for the document.
If I download the entire document, change something small (for example, update the field with numbers), and using the save()
method will mongo clear the entire document to disk or only update BSON, which has changed? Ultimately, my question is, should I complicate my code with update()
to save on I / O, or use only save()
?
This is not purely due to laziness, the document (after it is read in its entirety) goes through a series of steps for changing / processing the document, and if any changes have been made, the entire document will be saved. But if the cost of saving a document is high, I might have to think about it differently ...
source share