Interface RemoteMongoCursor<ResultT>
-
- Type Parameters:
ResultT
- The type of documents the cursor contains
- All Superinterfaces:
AutoCloseable
,Closeable
public interface RemoteMongoCursor<ResultT> extends Closeable
The Mongo Cursor interface. An application should ensure that a cursor is closed in all circumstances, e.g. using a try-with-resources statement.
-
-
Method Detail
-
hasNext
Task<Boolean> hasNext()
Returns whether or not there is a next document to retrieve withnext()
.- Returns:
- A
Task
containing whether or not there is a next document to retrieve withnext()
.
-
next
Task<ResultT> next()
Returns the next document.- Returns:
- A
Task
containing the next document if available or a failed task with aNoSuchElementException
exception.
-
-