Doubts about mongodb How to Express the Many-to-Many-One-to-Many Relationship

  mongodb, question

For example, blog type, an article can have multiple comments. But what if I have a requirement to list all the comments? For example, Siebel cnbeta has one of the hottest reviews, not for one article but for all articles in the library. How does mongodb operate or design the database in this situation?

In MongoDB, many-to-many and one-to-many relationships can be implemented in two ways, including

  1. Embedded mode
  2. Reference mode

The two methods have their own advantages and disadvantages and applicable scenarios, which require users to apply them according to their own needs.

For referenceThis article