I have a question regarding allowDiskUse=True, I am using pymongo and I wrote a large query and due to it
size I have to use allowDiskUse=True in order to make the query run, but when I’m looping through the received cursor object it seems as it empty.
Can someone please show how to loop through received data ?
The code you posted for looping through the result set looks ok, so it might be the query itself. For some simple sanity check: is the query actually returns anything (e.g. try it out in the mongo shell), does the collection has any data in it, and please check if you’re connecting to the correct server
I suggest trying out with a simpler query (e.g. a small find()) and check if it returns the expected result.
Since there is nothing wrong with your looping code, and you are certain you are connected to the correct server and the correct database, the only place to look is the query itself and how the method was called.
If you can post a simplified code, it will be helpful to spot issues with it.