0

I am querying a collection having about 4 million documents.

While looping over them with a python script i get always an error after about 5000 documents

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

Is there something which I can do in the configuration ? Changing Batchsize ore something ?

Dukeatcoding
  • 1,363
  • 2
  • 20
  • 34

0 Answers0