Class FindIterable<ResultT>

  • Type Parameters:
    ResultT - The type to which this iterable will decode documents.

    public class FindIterable<ResultT>
    extends MongoIterable<ResultT>
    Specific iterable for MongoCollection.find() operations.
    • Constructor Detail

    • Method Detail

      • filter

        public FindIterable<ResultT> filter​(@Nullable
                                            Bson filter)
        Sets the query filter to apply to the query.
        Parameters:
        filter - the filter, which may be null.
        Returns:
        this
      • limit

        public FindIterable<ResultT> limit​(int limit)
        Sets the limit to apply.
        Parameters:
        limit - the limit, which may be 0
        Returns:
        this
      • projection

        public FindIterable<ResultT> projection​(@Nullable
                                                Bson projection)
        Sets a document describing the fields to return for all matching documents.
        Parameters:
        projection - the project document, which may be null.
        Returns:
        this
      • sort

        public FindIterable<ResultT> sort​(@Nullable
                                          Bson sort)
        Sets the sort criteria to apply to the query.
        Parameters:
        sort - the sort criteria, which may be null.
        Returns:
        this