报错:
Executor error during find command: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.
MongoDB Server对于Sort排序能够支持的最大内存限制查看:
[root@database ~]# mongo
MongoDB shell version v3.4.24
> use admin
switched to db admin
>db.runCommand({ getParameter : 1, "internalQueryExecMaxBlockingSortBytes" : 1 } )
{ "internalQueryExecMaxBlockingSortBytes" : 33554432, "ok" : 1 } #确认为32M
设置大小:
> db.adminCommand({setParameter:1, internalQueryExecMaxBlockingSortBytes:335544320})
{ "was" : 33554432, "ok" : 1 }