比如,博客类型,一篇文章可以有多条评论。但是如果我有个需求是列出所有的评论呢?比如西贝cnbeta有一个被顶的最火的评论,不是针对于一篇文章而是针对于库里所有文章的评论。这种情形mongodb怎么操作或设计数据库?
ringa_lee2017-04-21 11:19:07
In MongoDB, many-to-many and one-to-many relationships can be implemented in two ways, including
Both methods have their own advantages, disadvantages and applicable scenarios, and users need to apply them according to their own needs
You can refer to this article