java.lang.Object
org.springframework.data.mongodb.core.query.Meta

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

    • Meta

      public Meta()
  • Method Details

    • 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
    • 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.
    • 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 FindIterable.
      Parameters:
      option - must not be null.
      Returns:
      Since:
      1.10
    • getFlags

      public Set<Meta.CursorOption> getFlags()
      Returns:
      never null.
      Since:
      1.10
    • getAllowDiskUse

      @Nullable public Boolean getAllowDiskUse()
      When set to true, aggregation stages can write data to disk.
      Returns:
      null if not set.
      Since:
      3.0
    • setAllowDiskUse

      public void setAllowDiskUse(@Nullable Boolean allowDiskUse)
      Enables writing to temporary files for aggregation stages and queries. When set to true, aggregation stages can write data to the _tmp subdirectory in the dbPath directory.

      Starting in MongoDB 4.2, the profiler log messages and diagnostic log messages includes a usedDisk indicator if any aggregation stage wrote data to temporary files due to memory restrictions.

      Parameters:
      allowDiskUse - use null for server defaults.
      Since:
      3.0
    • hasValues

      public boolean hasValues()
      Returns:
    • values

      public Iterable<Map.Entry<String,Object>> values()
      Get Iterable of set meta values.
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object