Does the list operation load integer data on first call?
1 answer
Jongo MongoCursor
uses Mongo regular DBCursor
under the hood. DBCursor
loads items lazily (as usual, all cursors). Ie, your entire collection will not be loaded into memory, it will be lazy loaded while you iterate over the cursor.
Relevant source from Jongo, where cursor
- DBCursor
.
public E next() {
if (!hasNext())
throw new NoSuchElementException();
DBObject dbObject = cursor.next();
return resultHandler.map(dbObject);
}
+2
source to share