The mongo library used in my project is Mongoengine
I often find the error 'pymongo. errors. CursorNotFound: Cursor not found' in the logs. After investigation, it was found that the mongo server actively closed the spatial link, and this error occurred when the link was used again. But I couldn't find an introduction to setting "maxIdleTimeMS" in the Mongoengine related documents.
Can someone help me
By the information here. You can setting maxIdleTimeMS by config
MONGODB_MAXIDLETIMEMS. if you useMONGODB_SETTINGS, you would usemaxidletimemsExample: