亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

mongodb為什么同樣的集合,兩次插入的順序會有變化呢?
天蓬老師
天蓬老師 2017-04-24 09:12:02
0
1
565

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進步~~

reply all(1)
伊謝爾倫

If you are referring to the change in the order of fields, it is because JSON itself defines Object as a collection of fields, which is unordered. But MongoDB proactively maintains the order of attributes.

MongoDB preserves the order of the document fields following write operations except for the following cases:

  1. The _id field is always the first field in the document.
  2. Updates that include renaming of field names may result in the reordering of fields in the document.

Changed in version 2.6: Starting in version 2.6, MongoDB actively attempts to preserve the field order in a document. Before version 2.6, MongoDB did not actively preserve the order of the fields in a document.

Why does the order of attributes change? This is because the implementation of collections in each language is different. For example, dict in python does not maintain the order, so the order has changed when it is passed to the driver. If you want to maintain the order, the driver provides an ordered collection, such as SON in python.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template