<legend id='cYpUv'><style id='cYpUv'><dir id='cYpUv'><q id='cYpUv'></q></dir></style></legend>

    • <bdo id='cYpUv'></bdo><ul id='cYpUv'></ul>
  • <i id='cYpUv'><tr id='cYpUv'><dt id='cYpUv'><q id='cYpUv'><span id='cYpUv'><b id='cYpUv'><form id='cYpUv'><ins id='cYpUv'></ins><ul id='cYpUv'></ul><sub id='cYpUv'></sub></form><legend id='cYpUv'></legend><bdo id='cYpUv'><pre id='cYpUv'><center id='cYpUv'></center></pre></bdo></b><th id='cYpUv'></th></span></q></dt></tr></i><div id='cYpUv'><tfoot id='cYpUv'></tfoot><dl id='cYpUv'><fieldset id='cYpUv'></fieldset></dl></div>

      1. <small id='cYpUv'></small><noframes id='cYpUv'>

        <tfoot id='cYpUv'></tfoot>

        是否可以在 Pymongo 中创建一个没有光标超时的聚合?

        时间:2023-08-30

            <tbody id='cWMUC'></tbody>
          <i id='cWMUC'><tr id='cWMUC'><dt id='cWMUC'><q id='cWMUC'><span id='cWMUC'><b id='cWMUC'><form id='cWMUC'><ins id='cWMUC'></ins><ul id='cWMUC'></ul><sub id='cWMUC'></sub></form><legend id='cWMUC'></legend><bdo id='cWMUC'><pre id='cWMUC'><center id='cWMUC'></center></pre></bdo></b><th id='cWMUC'></th></span></q></dt></tr></i><div id='cWMUC'><tfoot id='cWMUC'></tfoot><dl id='cWMUC'><fieldset id='cWMUC'></fieldset></dl></div>

              <legend id='cWMUC'><style id='cWMUC'><dir id='cWMUC'><q id='cWMUC'></q></dir></style></legend>
            1. <tfoot id='cWMUC'></tfoot>
            2. <small id='cWMUC'></small><noframes id='cWMUC'>

                <bdo id='cWMUC'></bdo><ul id='cWMUC'></ul>

                  本文介绍了是否可以在 Pymongo 中创建一个没有光标超时的聚合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  聚合看起来像:

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

                  失败了

                  OperationFailure:无法识别的字段noCursorTimeout"

                  OperationFailure: unrecognized field 'noCursorTimeout'

                  从 Pymongo 文档中可以看出 no_cursor_timeout 可以与 find() 一起使用,但是我一直没有成功为 aggregate() 找到可比较的 **kwargs.

                  It appears from the Pymongo documentation that no_cursor_timeout can be used with find(), however I have been unsuccessful locating a comparable **kwargs for aggregate().

                  我不想使用 setParameter 或 maxTimeMS.

                  I do not want to use setParameter or maxTimeMS.

                  更新:

                  来自 MongoDB 的 Jira 站点:SERVER-15042

                  From MongoDB's Jira Site: SERVER-15042

                  OP_QUERY 标头中的 NoCursorTimeout 位可防止服务器关闭空闲超过 10 分钟的游标.如果客户可能花费超过 10 分钟来处理一批结果,则可以设置此位.

                  The NoCursorTimeout bit in the OP_QUERY header prevents the server from closing a cursor that's idle for more than 10 minutes. Clients can set this bit if they may spend more than 10 minutes processing a batch of results.

                  aggregate"和parallelCollectionScan"命令也应该允许客户端关闭光标超时.

                  The "aggregate" and "parallelCollectionScan" commands should allow the client to turn off cursor timeouts, too.

                  对这张票的回应是:

                  我们故意不支持 noCursorTimeout.理由当我们实现游标保持活动时,需要这个就会消失.那将在 SERVER-6036 中跟踪工作.

                  We intentionally do not support noCursorTimeout. The rationale for needing this will go away when we implement cursor keepalive. That work will be tracked in SERVER-6036.

                  查看 SERVER-6036:

                  • 更新时间:2016 年 9 月 14 日下午 3:53:05 GMT+0000
                  • 状态:开放
                  • 解决方案:未解决
                  • 修复版本/s:已计划但未计划

                  如果我已正确阅读文档,则聚合()尚不存在游标无超时选项.

                  If I have read the documents correctly, a cursor no timeout option does not exist yet for aggregate().

                  推荐答案

                  你是对的,不能在单个聚合游标上禁用游标超时.但是我们提供了一个全局配置设置,cursorTimeoutMillis,您可以将其增加到一个大数字:

                  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
                  

                  请参阅 SERVER-8188 了解 MongoDB 版本信息,以及如何在以下位置设置此参数运行时.

                  See SERVER-8188 for MongoDB version info, and how to set this parameter at runtime.

                  这篇关于是否可以在 Pymongo 中创建一个没有光标超时的聚合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Python 在 Excel (.xlsx) 中查找和替换字符串 下一篇:将系统命令转换为 python 以进行文件搜索和删除

                  相关文章

                    <small id='KFqer'></small><noframes id='KFqer'>

                  1. <legend id='KFqer'><style id='KFqer'><dir id='KFqer'><q id='KFqer'></q></dir></style></legend>

                      <bdo id='KFqer'></bdo><ul id='KFqer'></ul>

                    <i id='KFqer'><tr id='KFqer'><dt id='KFqer'><q id='KFqer'><span id='KFqer'><b id='KFqer'><form id='KFqer'><ins id='KFqer'></ins><ul id='KFqer'></ul><sub id='KFqer'></sub></form><legend id='KFqer'></legend><bdo id='KFqer'><pre id='KFqer'><center id='KFqer'></center></pre></bdo></b><th id='KFqer'></th></span></q></dt></tr></i><div id='KFqer'><tfoot id='KFqer'></tfoot><dl id='KFqer'><fieldset id='KFqer'></fieldset></dl></div>

                  2. <tfoot id='KFqer'></tfoot>