collection有多个文档,如果查询结果没有进行sort排序,那么find()的结果集的默认顺序是以什么为标准的?
黄舟2017-04-22 09:02:24
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
ringa_lee2017-04-22 09:02:24
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.