Monday, 14 September 2020

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

 

Error: 

Error: error: {

        "ok" : 0,

        "errmsg" : "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.",

        "code" : 96,

        "codeName" : "OperationFailed"

}


Solution: 

         when you execute query on large collection that time error will come. use limit() method to get data.

db.employees.find().sort({employee_id: 1 } ).limit(1)




No comments:

Post a Comment

kernel:watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [sh:57366]

 Error:   kernel:watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [sh:57366] Solution:  server1:~ # echo 20 > /proc/sys/kernel/watchdog_...