I am using MongoDB 2.6.3, sharded, and I am running my queries using Java Driver 2.11.3 .
On my application side, I have a query which runs a find() request against MongoDB (which returns a huge number of documents) and then using the returned cursor, it retrieves matching documents one-by-one and processes each separately (before moving to the next matching document in Cursor). As the processing takes some time and find() returns many documents, I get time-out exception on my cursor, which breaks the query in the middle and leaves me with incomplete results. I have seen several posts on cursor timeOut issue in MongoDB, but most of them were old (back from 2010) and they are not talking about the case when one is using the Java Driver.
Given the fact that I am using latest MongoDB and my client is Java Driver, and I am wondering what is the best/correct way to increase/disable timeOut for my curosor ?