Class AggregationOptions

    • Constructor Detail

      • AggregationOptions

        public AggregationOptions()
    • Method Detail

      • allowDiskUse

        @Deprecated(forRemoval=true,
                    since="2.3")
        public boolean allowDiskUse()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the configuration value
      • allowDiskUse

        public AggregationOptions allowDiskUse​(boolean allowDiskUse)
        Enables writing to temporary files.
        Parameters:
        allowDiskUse - true to enable
        Returns:
        this
      • apply

        @MorphiaInternal
        public <S,​T> AggregateIterable<S> apply​(List<Document> documents,
                                                      MongoCollection<T> collection,
                                                      Class<S> resultType)
        Applies the configured options to the collection.
        Type Parameters:
        T - the collection type
        S - the result type
        Parameters:
        documents - the stage documents
        collection - the collection to configure
        resultType - the result type
        Returns:
        the updated collection
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
      • batchSize

        @Deprecated(forRemoval=true,
                    since="2.3")
        public int batchSize()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the configuration value
      • batchSize

        public AggregationOptions batchSize​(int batchSize)
        Sets the batch size for fetching results.
        Parameters:
        batchSize - the size
        Returns:
        this
      • bypassDocumentValidation

        @Deprecated(forRemoval=true,
                    since="2.3")
        public boolean bypassDocumentValidation()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the configuration value
      • bypassDocumentValidation

        public AggregationOptions bypassDocumentValidation​(boolean bypassDocumentValidation)
        Enables the aggregation to bypass document validation during the operation. This lets you insert documents that do not meet the validation requirements.

        Applicable only if you specify the $out or $merge aggregation stages.

        Parameters:
        bypassDocumentValidation - true to enable the bypass
        Returns:
        this
      • collation

        @Deprecated(forRemoval=true,
                    since="2.3")
        public Collation collation()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the configuration value
      • collation

        public AggregationOptions collation​(Collation collation)
        Specifies the collation to use for the operation.

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

        Parameters:
        collation - the collation to use
        Returns:
        this
      • hint

        @Deprecated(forRemoval=true,
                    since="2.3")
        public Document hint()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the hint for which index to use. A null value means no hint is set.
        Since:
        2.0
        Since server release
        3.6
      • maxTime

        public long maxTime​(TimeUnit unit)
        Parameters:
        unit - the target unit type
        Returns:
        the configuration value
      • maxTimeMS

        @Deprecated(forRemoval=true,
                    since="2.3")
        public long maxTimeMS()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the configuration value
      • hint

        public AggregationOptions hint​(String hint)
        Sets the hint for which index to use. A null value means no hint is set.
        Parameters:
        hint - the hint
        Returns:
        this
        Since:
        3.6
        Since server release
        3.6
      • maxTimeMS

        public AggregationOptions maxTimeMS​(long maxTimeMS)
        Specifies a time limit in milliseconds for processing operations on a cursor. If you do not specify a value for maxTimeMS, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior.
        Parameters:
        maxTimeMS - the max time in milliseconds
        Returns:
        this