我正在查询一个包含大约 400 万个文档的集合。
在使用 python 脚本循环它们时,在大约 5000 个文档之后总是会出错
Traceback (most recent call last):
File "geturl.py", line 16, in <module>
for dict in collection.find():
File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 814, in next
if len(self.__data) or self._refresh():
File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 776, in _refresh
limit, self.__id))
File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 720, in __send_message
self.__uuid_subtype)
File "/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py", line 93, in _unpack_response
cursor_id)
pymongo.errors.OperationFailure: cursor id '3664670275997321547' not valid at server
我可以在配置中做些什么吗?更改 Batchsize 矿石?