262: ExceededTimeLimit (error code 262)
MongoDBWhat does it mean?
The operation exceeded the time limit allowed on the server side and was terminated. Exceeding maxTimeMS or internal time limits can cause this error.
Why does it happen?
A long-running query/command, slow execution due to a missing index, heavy aggregation, scanning a large data set, or heavy server load.
How to fix it
Inspect the query with explain() and add an appropriate index. Split the operation into smaller chunks. Set maxTimeMS according to the actual need. Reduce data early in the aggregation pipeline with $match/$project. Verify that server resources are sufficient.