Package dev.morphia.aggregation
Class AggregationOptions
- java.lang.Object
-
- dev.morphia.aggregation.AggregationOptions
-
- All Implemented Interfaces:
dev.morphia.internal.CollectionConfigurable<AggregationOptions>,dev.morphia.internal.CollectionConfiguration,dev.morphia.internal.ReadConfigurable<AggregationOptions>,dev.morphia.internal.WriteConfigurable<AggregationOptions>
public class AggregationOptions extends Object implements dev.morphia.internal.ReadConfigurable<AggregationOptions>, dev.morphia.internal.WriteConfigurable<AggregationOptions>, dev.morphia.internal.CollectionConfigurable<AggregationOptions>
Defines options to be applied to an aggregation pipeline.
-
-
Constructor Summary
Constructors Constructor Description AggregationOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanallowDiskUse()Deprecated, for removal: This API element is subject to removal in a future version.AggregationOptionsallowDiskUse(boolean allowDiskUse)Enables writing to temporary files.intbatchSize()Deprecated, for removal: This API element is subject to removal in a future version.AggregationOptionsbatchSize(int batchSize)Sets the batch size for fetching results.booleanbypassDocumentValidation()Deprecated, for removal: This API element is subject to removal in a future version.AggregationOptionsbypassDocumentValidation(boolean bypassDocumentValidation)Enables the aggregation to bypass document validation during the operation.Collationcollation()Deprecated, for removal: This API element is subject to removal in a future version.AggregationOptionscollation(Collation collation)Specifies the collation to use for the operation.Stringcollection()Returns the alternate collection to use for the operation.AggregationOptionscollection(String collection)Specify an alternate collection to aggregate from rather than the collection mapped to the type used to create the aggregation initially.Documenthint()Deprecated, for removal: This API element is subject to removal in a future version.AggregationOptionshint(String hint)Sets the hint for which index to use.longmaxTime(TimeUnit unit)longmaxTimeMS()Deprecated, for removal: This API element is subject to removal in a future version.AggregationOptionsmaxTimeMS(long maxTimeMS)Specifies a time limit in milliseconds for processing operations on a cursor.ReadConcernreadConcern()Gets the read concernAggregationOptionsreadConcern(ReadConcern readConcern)Specifies the read concern.ReadPreferencereadPreference()AggregationOptionsreadPreference(ReadPreference readPreference)Sets the read preference to useStringtoString()WriteConcernwriteConcern()The write concern to use.AggregationOptionswriteConcern(WriteConcern writeConcern)Sets the write concern to use-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
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
-
maxTime
public long maxTime(TimeUnit unit)
- Parameters:
unit- the target unit type- Returns:
- the configuration value
-
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
-
collection
public AggregationOptions collection(String collection)
Specify an alternate collection to aggregate from rather than the collection mapped to the type used to create the aggregation initially.- Specified by:
collectionin interfacedev.morphia.internal.CollectionConfigurable<AggregationOptions>- Parameters:
collection- the name of the collection to use- Returns:
- Since:
- 2.3
-
collection
public String collection()
Description copied from interface:dev.morphia.internal.CollectionConfigurableReturns the alternate collection to use for the operation. Might return null.- Specified by:
collectionin interfacedev.morphia.internal.CollectionConfigurable<AggregationOptions>- Returns:
- the collection name or null
-
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
-
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
@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
-
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
-
readConcern
public ReadConcern readConcern()
Description copied from interface:dev.morphia.internal.ReadConfigurableGets the read concern- Specified by:
readConcernin interfacedev.morphia.internal.ReadConfigurable<AggregationOptions>- Returns:
- the configuration value
-
readPreference
public ReadPreference readPreference()
- Specified by:
readPreferencein interfacedev.morphia.internal.ReadConfigurable<AggregationOptions>- Returns:
- the configuration value
-
readConcern
public AggregationOptions readConcern(ReadConcern readConcern)
Specifies the read concern.- Specified by:
readConcernin interfacedev.morphia.internal.ReadConfigurable<AggregationOptions>- Parameters:
readConcern- the read concern to use- Returns:
- this
-
readPreference
public AggregationOptions readPreference(ReadPreference readPreference)
Sets the read preference to use- Specified by:
readPreferencein interfacedev.morphia.internal.ReadConfigurable<AggregationOptions>- Parameters:
readPreference- the read preference- Returns:
- this
-
writeConcern
public AggregationOptions writeConcern(@Nullable WriteConcern writeConcern)
Sets the write concern to use- Specified by:
writeConcernin interfacedev.morphia.internal.WriteConfigurable<AggregationOptions>- Parameters:
writeConcern- the write concern- Returns:
- this
-
writeConcern
@Nullable public WriteConcern writeConcern()
Description copied from interface:dev.morphia.internal.WriteConfigurableThe write concern to use. By default the write concern configured for the MongoCollection instance will be used.- Specified by:
writeConcernin interfacedev.morphia.internal.WriteConfigurable<AggregationOptions>- Returns:
- the configuration value
-
-