python - mongodb cursor id not valid error -
i trying iterate through loop: for doc in coll.find() i following error @ 100,000th plus record. file "build\bdist.win32\egg\pymongo\cursor.py", line 703, in next file "build\bdist.win32\egg\pymongo\cursor.py", line 679, in _refresh file "build\bdist.win32\egg\pymongo\cursor.py", line 628, in __send_message file "build\bdist.win32\egg\pymongo\helpers.py", line 95, in _unpack_response pymongo.errors.operationfailure: cursor id '1236484850793' not valid @ server what error mean? maybe cursor timed out on server. see if problem, try set timeout=false`: for doc in coll.find(timeout=false) see http://api.mongodb.org/python/1.6/api/pymongo/collection.html#pymongo.collection.collection.find if timeout problem 1 possible solution set batch_size (s. other answers).