Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
com.mongodb.client

Interface FindIterable<TResult>

  • Type Parameters:
    TResult - The type of the result.
    All Superinterfaces:
    Iterable<TResult>, MongoIterable<TResult>


    public interface FindIterable<TResult>
    extends MongoIterable<TResult>
    Iterable for find.
    Since:
    3.0
    • Method Detail

      • filter

        FindIterable<TResult> filter(Bson filter)
        Sets the query filter to apply to the query.
        Parameters:
        filter - the filter, which may be null.
        Returns:
        this
        MongoDB documentation
        Filter
      • limit

        FindIterable<TResult> limit(int limit)
        Sets the limit to apply.
        Parameters:
        limit - the limit, which may be null
        Returns:
        this
        MongoDB documentation
        Limit
      • skip

        FindIterable<TResult> skip(int skip)
        Sets the number of documents to skip.
        Parameters:
        skip - the number of documents to skip
        Returns:
        this
        MongoDB documentation
        Skip
      • maxTime

        FindIterable<TResult> maxTime(long maxTime,
                                      TimeUnit timeUnit)
        Sets the maximum execution time on the server for this operation.
        Parameters:
        maxTime - the max time
        timeUnit - the time unit, which may not be null
        Returns:
        this
        MongoDB documentation
        Max Time
      • maxAwaitTime

        FindIterable<TResult> maxAwaitTime(long maxAwaitTime,
                                           TimeUnit timeUnit)
        The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. This only applies to a TAILABLE_AWAIT cursor. When the cursor is not a TAILABLE_AWAIT cursor, this option is ignored. On servers >= 3.2, this option will be specified on the getMore command as "maxTimeMS". The default is no value: no "maxTimeMS" is sent to the server with the getMore command. On servers < 3.2, this option is ignored, and indicates that the driver should respect the server's default value A zero value will be ignored.
        Parameters:
        maxAwaitTime - the max await time
        timeUnit - the time unit to return the result in
        Returns:
        the maximum await execution time in the given time unit
        Since:
        3.2
        MongoDB documentation
        Max Time
      • modifiers

        FindIterable<TResult> modifiers(Bson modifiers)
        Sets the query modifiers to apply to this operation.
        Parameters:
        modifiers - the query modifiers to apply, which may be null.
        Returns:
        this
        MongoDB documentation
        Query Modifiers
      • projection

        FindIterable<TResult> projection(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
        MongoDB documentation
        Projection
      • sort

        FindIterable<TResult> sort(Bson sort)
        Sets the sort criteria to apply to the query.
        Parameters:
        sort - the sort criteria, which may be null.
        Returns:
        this
        MongoDB documentation
        Sort
      • noCursorTimeout

        FindIterable<TResult> noCursorTimeout(boolean noCursorTimeout)
        The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.
        Parameters:
        noCursorTimeout - true if cursor timeout is disabled
        Returns:
        this
      • oplogReplay

        FindIterable<TResult> oplogReplay(boolean oplogReplay)
        Users should not set this under normal circumstances.
        Parameters:
        oplogReplay - if oplog replay is enabled
        Returns:
        this
      • partial

        FindIterable<TResult> partial(boolean partial)
        Get partial results from a sharded cluster if one or more shards are unreachable (instead of throwing an error).
        Parameters:
        partial - if partial results for sharded clusters is enabled
        Returns:
        this
      • cursorType

        FindIterable<TResult> cursorType(CursorType cursorType)
        Sets the cursor type.
        Parameters:
        cursorType - the cursor type
        Returns:
        this
      • collation

        FindIterable<TResult> collation(Collation collation)
        Sets the collation options

        A null value represents the server default.

        Parameters:
        collation - the collation options to use
        Returns:
        this
        Since:
        3.4
        Since server release
        3.4