Does MongoDB's $in clause guarantee order

后端 未结 10 1252
春和景丽
春和景丽 2020-11-22 01:39

When using MongoDB\'s $in clause, does the order of the returned documents always correspond to the order of the array argument?

10条回答
  •  抹茶落季
    2020-11-22 02:00

    Always? Never. The order is always the same: undefined (probably the physical order in which documents are stored). Unless you sort it.

提交回复
热议问题