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

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

Get informations

> use admin
> db.runCommand( { getParameter : 1, "internalQueryExecMaxBlockingSortBytes" : 1 })
{ "internalQueryExecMaxBlockingSortBytes" : 33554432, "ok" : 1 }

Increase limit to 64M

> db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes:67108864})
{ "was" : 33554432, "ok" : 1 }

Increase limit to 256M

> db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes:268435456})
{ "was" : 67108864, "ok" : 1 }