开发者

MongoDB lists with paginations?

for documents with lists with pagination, is it better to embed or use reference? im reading the custom type "SONManipulator" and it appears to transform every thing 开发者_StackOverflow中文版on retrieval, even the sub docs. i want to keep the list in the document sorted, should this impact anything?


I don't fully understand your question, but it is generally better to embed documents for performance reasons. That is one of the major advantages of MongoDB's approach, data locality. The pymongo lib uses SON sorted dict implementation which will maintain the ordering of your document keys.

If you document contains a list/array of elements and you are concerned about the ordering of the elements, fear not because the array order is maintained as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜