Right now I am working on MongoDB in ASP.NET and just gone through an article in which it has taken a blog post example and mentioned the following steps to update comments (sub document).
- The blog was taken a main document
- Comments were taken as sub document and posted along with main document
- When we need to insert a new comment to a particular blog, we are getting the existing blog document, adding new comment (sub document) in front-end and again updating the blog document with blog ID.
If it is the case, let us take very popular blog scenario where thousands of comments were posted to a blog. If any new comment has to be posted, we need to get all the existing comments from DB server to Web server as a result it will increase network traffic.
Is this general scenario or is there any alternative way to add new content to sub document? Means, I need a functionality which should just insert new values in existing document.