Interface MongoIterable<TResult>

    • Method Detail

      • first

        void first​(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​(Block<? super TResult> block,
                     SingleResultCallback<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 document
        callback - a callback that completed once the iteration has completed
      • into

        <A extends Collection<? super TResult>> void into​(A target,
                                                          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 into
        callback - a callback that will be passed the target containing all documents
      • map

        <U> MongoIterable<U> map​(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
        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