Package io.vertx.mongo
Interface MongoResult<TDocument>
-
- All Known Subinterfaces:
GridFSDownloadResult
,MongoCollectionResult<TDocument>
public interface MongoResult<TDocument>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Future<java.util.List<TDocument>>
all()
Returns a future of the list containing all items of the resultdefault void
all(Handler<AsyncResult<java.util.List<TDocument>>> resultHandler)
Handler called with a list containing all items of the resultFuture<TDocument>
first()
Returns a future of the first item of the resultdefault void
first(Handler<AsyncResult<TDocument>> resultHandler)
Handler called with the first item of the resultFuture<java.util.List<TDocument>>
some(int maxItems)
Returns a future of the list containing some items of the resultdefault void
some(int maxItems, Handler<AsyncResult<java.util.List<TDocument>>> resultHandler)
Handler called with a list containing some items of the resultReadStream<TDocument>
stream()
Returns the result as a read stream of itemsReadStream<TDocument>
stream(int batchSize)
Returns the result as a read stream of items
-
-
-
Method Detail
-
first
default void first(Handler<AsyncResult<TDocument>> resultHandler)
Handler called with the first item of the result- Parameters:
resultHandler
- handler
-
first
Future<TDocument> first()
Returns a future of the first item of the result- Returns:
- a future of the first item of the result
-
all
default void all(Handler<AsyncResult<java.util.List<TDocument>>> resultHandler)
Handler called with a list containing all items of the result- Parameters:
resultHandler
- handler called with a list containing all items of the result
-
all
Future<java.util.List<TDocument>> all()
Returns a future of the list containing all items of the result- Returns:
- a future of the list containing all items of the result
-
some
default void some(int maxItems, Handler<AsyncResult<java.util.List<TDocument>>> resultHandler)
Handler called with a list containing some items of the result- Parameters:
maxItems
- maximum number of itemsresultHandler
- handler called with a list containing some items of the result
-
some
Future<java.util.List<TDocument>> some(int maxItems)
Returns a future of the list containing some items of the result- Parameters:
maxItems
- maximum number of items- Returns:
- a future of the list containing some items of the result
-
stream
ReadStream<TDocument> stream()
Returns the result as a read stream of items- Returns:
- read stream of items
-
stream
ReadStream<TDocument> stream(int batchSize)
Returns the result as a read stream of items- Parameters:
batchSize
- batch size- Returns:
- read stream of items
-
-