@
ljbha007 @
cdxem713 感谢两位,有点明白了,我现在理解的是:
把所有小说的所有章节都保存在同一个 collection 下面,是不是变成这样:
db.chapter.collection:
[
{bookid: 1, chapterid: 2, name:章节名, text:小说内容},
{bookid: 1, chapterid: 5, name:章节名, text:小说内容},
{bookid: 1, chapterid: 6, name:章节名, text:小说内容},
{bookid: 1, chapterid: 9, name:章节名, text:小说内容},
{bookid: 99, chapterid: 3, name:章节名, text:小说内容},
{bookid: 99, chapterid: 7, name:章节名, text:小说内容},
{bookid: 99, chapterid: 9, name:章节名, text:小说内容},
{bookid: 99, chapterid: 6, name:章节名, text:小说内容},
]
如果是这样,那 chapter 集合会很大很大,建索引是肯定的,
但查询的速度会因数据量不断变大而打拆扣吗?