Package com.mongodb.async.client
Interface MongoIterable<TResult>
-
- Type Parameters:
TResult- the result type
- All Known Subinterfaces:
AggregateIterable<TResult>,ChangeStreamIterable<TResult>,DistinctIterable<TResult>,FindIterable<T>,GridFSFindIterable,ListCollectionsIterable<TResult>,ListDatabasesIterable<T>,ListIndexesIterable<TResult>,MapReduceIterable<TResult>
Deprecated.Prefer the Reactive Streams-based asynchronous driver (mongodb-driver-reactivestreams artifactId)
@Deprecated public interface MongoIterable<TResult>Operations that allow asynchronous iteration over a collection view.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidbatchCursor(com.mongodb.async.SingleResultCallback<com.mongodb.async.AsyncBatchCursor<TResult>> callback)Deprecated.Provide the underlyingAsyncBatchCursorallowing fine grained control of the cursor.MongoIterable<TResult>batchSize(int batchSize)Deprecated.Sets the number of documents to return per batch.voidfirst(com.mongodb.async.SingleResultCallback<TResult> callback)Deprecated.Helper to return the first item in the iterator or null.voidforEach(com.mongodb.Block<? super TResult> block, com.mongodb.async.SingleResultCallback<java.lang.Void> callback)Deprecated.Iterates over all documents in the view, applying the given block to each, and completing the returned future after all documents have been iterated, or an exception has occurred.java.lang.IntegergetBatchSize()Deprecated.Gets the number of documents to return per batch or null if not set.<A extends java.util.Collection<? super TResult>>
voidinto(A target, com.mongodb.async.SingleResultCallback<A> callback)Deprecated.Iterates over all the documents, adding each to the given target.<U> MongoIterable<U>map(com.mongodb.Function<TResult,U> mapper)Deprecated.Maps this iterable from the source document type to the target document type.
-
-
-
Method Detail
-
first
void first(com.mongodb.async.SingleResultCallback<TResult> callback)
Deprecated.Helper to return the first item in the iterator or null.- Parameters:
callback- a callback that is passed the first item or null.
-
forEach
void forEach(com.mongodb.Block<? super TResult> block, com.mongodb.async.SingleResultCallback<java.lang.Void> callback)
Deprecated.Iterates over all documents in the view, applying the given block to each, and completing the returned future after all documents have been iterated, or an exception has occurred.- Parameters:
block- the block to apply to each documentcallback- a callback that completed once the iteration has completed
-
into
<A extends java.util.Collection<? super TResult>> void into(A target, com.mongodb.async.SingleResultCallback<A> callback)
Deprecated.Iterates over all the documents, adding each to the given target.- Type Parameters:
A- the collection type- Parameters:
target- the collection to insert intocallback- a callback that will be passed the target containing all documents
-
map
<U> MongoIterable<U> map(com.mongodb.Function<TResult,U> mapper)
Deprecated.Maps this iterable from the source document type to the target document type.- Type Parameters:
U- the target document type- Parameters:
mapper- a function that maps from the source to the target document type- Returns:
- an iterable which maps T to U
-
batchSize
MongoIterable<TResult> batchSize(int batchSize)
Deprecated.Sets the number of documents to return per batch.- Parameters:
batchSize- the batch size- Returns:
- this
- MongoDB documentation
- Batch Size
-
getBatchSize
@Nullable java.lang.Integer getBatchSize()
Deprecated.Gets the number of documents to return per batch or null if not set.- Returns:
- the batch size, which may be null
- Since:
- 3.7
- MongoDB documentation
- Batch Size
-
batchCursor
void batchCursor(com.mongodb.async.SingleResultCallback<com.mongodb.async.AsyncBatchCursor<TResult>> callback)
Deprecated.Provide the underlyingAsyncBatchCursorallowing fine grained control of the cursor.- Parameters:
callback- a callback that will be passed the AsyncBatchCursor
-
-