Answer the question
In order to leave comments, you need to log in
How to make nested comments in mongodb?
I use a meteor. You need to nest comments. There is a collection of comments that contains all comments with infinite nesting (replies to comments). Is this architecture normal? How to attach a new comment to the right place? And how to count all the comments given the replies?
Answer the question
In order to leave comments, you need to log in
How to attach a new comment to the right place?Looks like a link to a parent comment.
And how to count all the comments given the replies?In each comment, store a link to the post / article, so all the comments of the post can be taken out with one request, and when adding a comment, increment the "number of Comments" in the post document, this way you will have the number of comments on the post without downloading these same comments.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question