sort - mongodb 结果集默认顺序标准
怪我咯
怪我咯 2017-04-22 09:00:24
0
2
733

collection有多个文档,如果查询结果没有进行sort排序,那么find()的结果集的默认顺序是以什么为标准的?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
黄舟

Basically the order in the file (so it is often the order of insert).

To be cautious, you can think of it as disorder. If you need a specific order, you still have to use sort.

Reference:

http://docs.mongodb.org/manual/reference/glossary/#term-natural-order

左手右手慢动作

When mongodb inserts data, it will add the "_id" attribute by default and create an index with it. So it's the order of insertion.

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