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

The instance '****.**.**:3306' cannot be added to an InnoDB cluster because it has asynchronous (source-replica) replication channel(s) configured. MySQL InnoDB Cluster

  Error :    MySQL  JS > dba.checkInstanceConfiguration("root@192.*.*.*")  NOTE: Found unexpected replication channel '...