Is it possible to create an aggregation in Pymongo with no timeout for the cursor?

后端 未结 1 1826
面向向阳花
面向向阳花 2021-01-13 21:05

The aggregation looks like:

res = Things.objects._collection.aggregate(pipeline,
            allowDiskUse=True,
            batchSize=101,
            noCurs         


        
相关标签:
1条回答
  • 2021-01-13 21:42

    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.

    0 讨论(0)
提交回复
热议问题