Package io.realm.mongodb.mongo.iterable
Class MongoIterable<ResultT>
- java.lang.Object
-
- io.realm.mongodb.mongo.iterable.MongoIterable<ResultT>
-
- Type Parameters:
ResultT
- The type to which this iterable will decode documents.
- Direct Known Subclasses:
AggregateIterable
,FindIterable
public abstract class MongoIterable<ResultT> extends Object
The MongoIterable is the results from an operation, such as afind()
or anaggregate()
query.This class somewhat mimics the behavior of an
Iterable
but given its results are obtained asynchronously, its values are wrapped inside aTask
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RealmResultTask<ResultT>
first()
Helper to return the first item in the iterator or null.RealmResultTask<MongoCursor<ResultT>>
iterator()
Returns a cursor of the operation represented by this iterable.
-
-
-
Method Detail
-
iterator
public RealmResultTask<MongoCursor<ResultT>> iterator()
Returns a cursor of the operation represented by this iterable.The result is wrapped in a
Task
since the iterator should be capable of asynchronously retrieve documents from the server.- Returns:
- an asynchronous task with cursor of the operation represented by this iterable.
-
first
public RealmResultTask<ResultT> first()
Helper to return the first item in the iterator or null.The result is wrapped in a
Task
since the iterator should be capable of asynchronously retrieve documents from the server.- Returns:
- a task containing the first item or null.
-
-