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 on retrieval, even the sub docs.
i want to keep the list in the document sorted, should this impact
anything?
for documents with lists with pagination, is it better to embed or use reference?
Share
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.