org.springframework.data.mongodb.core.query

Class Meta



  • public class Meta
    extends Object
    Meta-data for Query instances.
    Since:
    1.6
    Author:
    Christoph Strobl, Oliver Gierke, Mark Paluch
    • Constructor Detail

      • Meta

        public Meta()
    • Method Detail

      • getMaxTimeMsec

        @Nullable
        public Long getMaxTimeMsec()
        Returns:
        null if not set.
      • setMaxTimeMsec

        public void setMaxTimeMsec(long maxTimeMsec)
        Set the maximum time limit in milliseconds for processing operations.
        Parameters:
        maxTimeMsec -
      • setMaxTime

        public void setMaxTime(Duration timeout)
        Set the maximum time limit for processing operations.
        Parameters:
        timeout - must not be null.
        Since:
        2.1
      • getMaxScan

        @Nullable
        public Long getMaxScan()
        Returns:
        null if not set.
      • setMaxScan

        @Deprecated
        public void setMaxScan(long maxScan)
        Deprecated. since 2.1 due to deprecation in MongoDB 4.0.
        Only scan the specified number of documents.
        Parameters:
        maxScan -
      • setComment

        public void setComment(String comment)
        Add a comment to the query that is propagated to the profile log.
        Parameters:
        comment -
      • getComment

        @Nullable
        public String getComment()
        Returns:
        null if not set.
      • setSnapshot

        @Deprecated
        public void setSnapshot(boolean useSnapshot)
        Deprecated. since 2.1 due to deprecation as of MongoDB 3.6
        Using snapshot prevents the cursor from returning a document more than once.
        Parameters:
        useSnapshot -
      • getSnapshot

        public boolean getSnapshot()
        Returns:
        null if not set.
      • getCursorBatchSize

        @Nullable
        public Integer getCursorBatchSize()
        Returns:
        null if not set.
        Since:
        2.1
      • setCursorBatchSize

        public void setCursorBatchSize(int cursorBatchSize)
        Apply the batch size (number of documents to return in each response) for a query.
        Use 0 (zero) for no limit. A negative limit closes the cursor after returning a single batch indicating to the server that the client will not ask for a subsequent one.
        Parameters:
        cursorBatchSize - The number of documents to return per batch.
        Since:
        2.1
      • addFlag

        public boolean addFlag(Meta.CursorOption option)
        Add Meta.CursorOption influencing behavior of the DBCursor.
        Parameters:
        option - must not be null.
        Returns:
        Since:
        1.10
      • hasValues

        public boolean hasValues()
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object