The aggregation looks like:
res = Things.objects._collection.aggregate(pipeline,
allowDiskUse=True,
batchSize=101,
noCurs
You're correct, cursor timeout can't be disabled on individual aggregation cursors. But we've provided a global config setting, cursorTimeoutMillis
, that you can increase to a large number:
mongod --setParameter cursorTimeoutMillis=600000 # 10 minutes
See SERVER-8188 for MongoDB version info, and how to set this parameter at runtime.