Java link MongoDB processing large amounts of data often encountered cursor not found exception, in fact, is caused by a timeout
Exception in thread ' main ' com.mongodb.mongoexception$cursornotfound:cursor not found on server
At Com.mongodb.dbapilayer$result.init (dbapilayer.java:379)
At Com.mongodb.dbapilayer$result._advance (dbapilayer.java:426)
At Com.mongodb.dbapilayer$result.hasnext (dbapilayer.java:408)
At Com.mongodb.dbcursor._hasnext (dbcursor.java:495)
At Com.mongodb.DBCursor.hasNext (dbcursor.java:515)
in the domestic forum to turn around, the solution is said to be unintelligible, in fact, the solution is very simple:
dbcursor cursor = Collection.find (condtion);
cursor.addoption (Com.mongodb.Bytes.QUERYOPTION_NOTIMEOUT);
As long as the query dbcursor add Com.mongodb.Bytes.QUERYOPTION_NOTIMEOUT to solve!
Com.mongodb.mongoexception$cursornotfound:cursor not found on server exception handling