Home > database >  Sort query mongo database error
Sort query mongo database error

Time:09-24

Db. Wr_record_feature. Find ({}). Sort (} {create_time: - 1) limit (50) to use this statement query data can


An error is as follows:
Error: Error: {
"WaitedMS" : NumberLong (0),
"Ok" : 0,
"Errmsg" : "Executor error during the find command: OperationFailed: Sort operation informs the wining the maximum 33554432 bytes of RAM. The Add an index, or specify a smaller limit.",
"Code" : 96
}

What reason is this excuse me? Has been created, and how to solve, database index,

CodePudding user response:

Sorting without sorting results from the memory, you need to separate memory for sorting operation, the memory limit to 32 m
Solve the two methods can be used,
1, create_time indexed
2, expand the sorting space db. AdminCommand ({setParameter: 1, internalQueryExecMaxBlockingSortBytes: 335544320})
  • Related