Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
Description
The while (cursor.hasNext()) loops indefinitely. collection.count() == 1520
public void queryCollectionAll() {
/*NOTE
finally to ensure cursor is closed so no leaking*/
MongoCollection<Document> collection = database.getCollection("test");
MongoCursor<Document> cursor = collection.find().iterator();
long count= 0;
System.out.println(collection.count());
try {
while (cursor.hasNext())
} finally
{ cursor.close(); System.out.println("collection.count():"+count); }
}