3 ms·
When I see the first example -- comments as a collection of the post document -- the first thing I think of is that editing a comment requires one to retrieve t
by encoderer 15y ago
When I see the first example -- comments as a collection of the post document -- the first thing I think of is that editing a comment requires one to retrieve the document, edit it, then save it back.
Is there some sort of repair process in mongo that prevents destructive updates in the case of 2 concurrent writes?
- enjo 15y agoMongo is single-master, so last-write-wins is how writes are resolved. However, they do support partial updating. So you only need to write the specific part of the document that you are actually changing.