Mongo Sort operation used more than the maximum 33554432 bytes of RAM

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36324685/article/details/81627762

Mongodb 报错的信息,当排序字段

Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller

这里写图片描述

代码,排序字段,需要加索引。或者,增加排序的内存,默认给的排序内存是32mb.
官网描述:
https://docs.mongodb.com/manual/reference/method/cursor.sort/index.html

这里写图片描述

这里写图片描述

官网推荐创建索引:

然后,把 sort 的字段 currentDate 创建索引就能用了。

猜你喜欢

转载自blog.csdn.net/qq_36324685/article/details/81627762