这是我的表结构:
网站有很多用户
每个用户都有许多博客
每个网络博客都有很多文章
每篇文章都有很多评论,
在mongoDB中最好的设计是什么?
是真的吗?
{
user:[
{name:"john",
weblog : [
{ name: "new blog",
article : [
{
title: "this is first article",
comment :[
{text": comment },
{...comment...},
{...comment...}
]
}
{...article...},
{...article...}
]
}
{...weblog...},
{...weblog...},
{...weblog...}
],
},
{ ...user... },
{ ...user... },
{ ...user... }
]
}它是标准的吗?
我觉得它太嵌套了。是搜索的noraml吗?

发布于 2016-09-15 17:30:08
这是救命稻草。
http://openmymind.net/Multiple-Collections-Versus-Embedded-Documents/#11
希望能帮助别人..。
最后我选择了分离的文件。
https://stackoverflow.com/questions/39507076
复制相似问题