工作中mongoDB排序内容超出sort默认内存

org.springframework.data.mongodb.UncategorizedMongoDbException: Query failed with error code 96 and error message ‘Executor error during find command :: caused by :: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.’ on server mongodb.miniserver.com:27017; nested exception is com.mongodb.MongoQueryException: Query failed with error code 96 and error message ‘Executor error during find command :: caused by :: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.’ on server mongodb.miniserver.com:27017

mongo中排序时出现如上报错:

翻译:

org.springframework.data.mongodb.UncategorizedMongoDB异常:查询失败,错误代码为96,错误消息为“查找命令期间执行程序错误:”,原因是::排序操作使用的RAM超过了最大33554432字节。添加索引,或指定一个较小的限制。

原因:

你可能感兴趣的:(mongodb,mongodb,数据库)