我正在查询一个包含大约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矿石?