Class AggregateOptions


  • public class AggregateOptions
    extends Object
    Options used to configure aggregate operations.
    Author:
    Nick Scavelli
    • Field Detail

      • DEFAULT_BATCH_SIZE

        public static final int DEFAULT_BATCH_SIZE
        The default value of batchSize = 20.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_TIME

        public static final long DEFAULT_MAX_TIME
        The default value of maxTime = 0.
        See Also:
        Constant Field Values
      • DEFAULT_MAX_AWAIT_TIME

        public static final long DEFAULT_MAX_AWAIT_TIME
        The default value of maxAwaitTime = 1000.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AggregateOptions

        public AggregateOptions()
        Default constructor
      • AggregateOptions

        public AggregateOptions​(AggregateOptions options)
        Copy constructor
        Parameters:
        options - the one to copy
      • AggregateOptions

        public AggregateOptions​(JsonObject options)
        Constructor from JSON
        Parameters:
        options - the JSON
    • Method Detail

      • getCollation

        public CollationOptions getCollation()
        Returns:
        Configured collationOptions
      • setCollation

        public AggregateOptions setCollation​(CollationOptions collation)
        Optional.

        Specifies the collation to use for the operation.

        Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks.

        Parameters:
        collation -
        Returns:
        reference to this, for fluency
      • toJson

        public JsonObject toJson()
        Convert to JSON
        Returns:
        the JSON
      • getMaxTime

        public long getMaxTime()
        Get the specified time limit in milliseconds for processing operations on a cursor. If you do not specify a value for maxTime, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior.
        Returns:
        the specified time limit in milliseconds for processing operations on a cursor
      • setMaxTime

        public AggregateOptions setMaxTime​(long maxTime)
        Set the time limit in milliseconds for processing operations on a cursor.
        Parameters:
        maxTime - the time limit in milliseconds for processing operations on a cursor
        Returns:
        reference to this, for fluency
      • getBatchSize

        public int getBatchSize()
        Returns:
        the batch size for methods loading found data in batches
      • setBatchSize

        public AggregateOptions setBatchSize​(int batchSize)
        Set the batch size for methods loading found data in batches.
        Parameters:
        batchSize - the number of documents in a batch
        Returns:
        reference to this, for fluency
      • getAllowDiskUse

        public Boolean getAllowDiskUse()
        Get the flag if writing to temporary files is enabled. When set to true, aggregation operations can write data to the _tmp subdirectory in the dbPath directory.
        Returns:
        true if writing to temporary files is enabled.
      • setAllowDiskUse

        public AggregateOptions setAllowDiskUse​(Boolean allowDiskUse)
        Set the flag if writing to temporary files is enabled.
        Parameters:
        allowDiskUse - the flag indicating disk usage on aggregate or not.
        Returns:
        reference to this, for fluency
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object