Package io.vertx.mongo.client
Class MapReduceOptions
- java.lang.Object
-
- io.vertx.mongo.client.MapReduceOptions
-
public class MapReduceOptions extends java.lang.ObjectOptions for map reduce.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description MapReduceOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MapReduceActiongetAction()java.lang.IntegergetBatchSize()CollationgetCollation()java.lang.StringgetCollectionName()java.lang.StringgetDatabaseName()JsonObjectgetFilter()java.lang.StringgetFinalizeFunction()java.lang.IntegergetLimit()java.lang.LonggetMaxTime()JsonObjectgetScope()JsonObjectgetSort()java.lang.BooleanisBypassDocumentValidation()java.lang.BooleanisJsMode()java.lang.BooleanisNonAtomic()Deprecated.java.lang.BooleanisSharded()Deprecated.java.lang.BooleanisVerbose()MapReduceOptionssetAction(MapReduceAction action)Specify theMapReduceActionto be used when writing to a collection.MapReduceOptionssetBatchSize(java.lang.Integer batchSize)Sets the number of documents to return per batch.MapReduceOptionssetBypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)Sets the bypass document level validation flag.MapReduceOptionssetCollation(Collation collation)Sets the collation optionsMapReduceOptionssetCollectionName(java.lang.String collectionName)Sets the collectionName for the output of the MapReduceMapReduceOptionssetDatabaseName(java.lang.String databaseName)Sets the name of the database to output into.MapReduceOptionssetFilter(JsonObject filter)Sets the query filter to apply to the query.MapReduceOptionssetFinalizeFunction(java.lang.String finalizeFunction)Sets the JavaScript function that follows the reduce method and modifies the output.MapReduceOptionssetJsMode(java.lang.Boolean jsMode)Sets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions.MapReduceOptionssetLimit(java.lang.Integer limit)Sets the limit to apply.MapReduceOptionssetMaxTime(java.lang.Long maxTime)Sets the maximum execution time on the server for this operation.MapReduceOptionssetNonAtomic(java.lang.Boolean nonAtomic)Deprecated.this option will no longer be supported in MongoDB 4.4 as it will no longer hold a global or database level write lock.MapReduceOptionssetScope(JsonObject scope)Sets the global variables that are accessible in the map, reduce and finalize functions.MapReduceOptionssetSharded(java.lang.Boolean sharded)Deprecated.this option will no longer be supported in MongoDB 4.4MapReduceOptionssetSort(JsonObject sort)Sets the sort criteria to apply to the query.MapReduceOptionssetVerbose(java.lang.Boolean verbose)Sets whether to include the timing information in the result information.
-
-
-
Method Detail
-
setCollectionName
public MapReduceOptions setCollectionName(java.lang.String collectionName)
Sets the collectionName for the output of the MapReduceThe default action is replace the collection if it exists, to change this use
action.- Parameters:
collectionName- the name of the collection that you want the map-reduce operation to write its output.- Returns:
- this
-
getCollectionName
public java.lang.String getCollectionName()
-
setFinalizeFunction
public MapReduceOptions setFinalizeFunction(java.lang.String finalizeFunction)
Sets the JavaScript function that follows the reduce method and modifies the output.- Parameters:
finalizeFunction- the JavaScript function that follows the reduce method and modifies the output.- Returns:
- this
- MongoDB documentation
- Requirements for the finalize Function
-
getFinalizeFunction
public java.lang.String getFinalizeFunction()
-
setScope
public MapReduceOptions setScope(JsonObject scope)
Sets the global variables that are accessible in the map, reduce and finalize functions.- Parameters:
scope- the global variables that are accessible in the map, reduce and finalize functions.- Returns:
- this
- MongoDB documentation
- mapReduce
-
getScope
public JsonObject getScope()
-
setSort
public MapReduceOptions setSort(JsonObject sort)
Sets the sort criteria to apply to the query.- Parameters:
sort- the sort criteria, which may be null.- Returns:
- this
- MongoDB documentation
- Sort
-
getSort
public JsonObject getSort()
-
setFilter
public MapReduceOptions setFilter(JsonObject filter)
Sets the query filter to apply to the query.- Parameters:
filter- the filter to apply to the query.- Returns:
- this
- MongoDB documentation
- Filter
-
getFilter
public JsonObject getFilter()
-
setLimit
public MapReduceOptions setLimit(java.lang.Integer limit)
Sets the limit to apply.- Parameters:
limit- the limit, which may be null- Returns:
- this
- MongoDB documentation
- Limit
-
getLimit
public java.lang.Integer getLimit()
-
setJsMode
public MapReduceOptions setJsMode(java.lang.Boolean jsMode)
Sets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions. Defaults to false.- Parameters:
jsMode- the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions- Returns:
- jsMode
- MongoDB documentation
- mapReduce
-
isJsMode
public java.lang.Boolean isJsMode()
-
setVerbose
public MapReduceOptions setVerbose(java.lang.Boolean verbose)
Sets whether to include the timing information in the result information.- Parameters:
verbose- whether to include the timing information in the result information.- Returns:
- this
-
isVerbose
public java.lang.Boolean isVerbose()
-
setMaxTime
public MapReduceOptions setMaxTime(java.lang.Long maxTime)
Sets the maximum execution time on the server for this operation.- Parameters:
maxTime- the max time (in milliseconds)- Returns:
- this
- MongoDB documentation
- Max Time
-
getMaxTime
public java.lang.Long getMaxTime()
-
setAction
public MapReduceOptions setAction(MapReduceAction action)
Specify theMapReduceActionto be used when writing to a collection.- Parameters:
action- anMapReduceActionto perform on the collection- Returns:
- this
-
getAction
public MapReduceAction getAction()
-
setDatabaseName
public MapReduceOptions setDatabaseName(java.lang.String databaseName)
Sets the name of the database to output into.- Parameters:
databaseName- the name of the database to output into.- Returns:
- this
- MongoDB documentation
- output with an action
-
getDatabaseName
public java.lang.String getDatabaseName()
-
setSharded
@Deprecated public MapReduceOptions setSharded(java.lang.Boolean sharded)
Deprecated.this option will no longer be supported in MongoDB 4.4Sets if the output database is sharded- Parameters:
sharded- if the output database is sharded- Returns:
- this
- MongoDB documentation
- output with an action
-
isSharded
@Deprecated public java.lang.Boolean isSharded()
Deprecated.
-
setNonAtomic
@Deprecated public MapReduceOptions setNonAtomic(java.lang.Boolean nonAtomic)
Deprecated.this option will no longer be supported in MongoDB 4.4 as it will no longer hold a global or database level write lock.Sets if the post-processing step will prevent MongoDB from locking the database. Valid only with theMapReduceAction.MERGEorMapReduceAction.REDUCEactions.- Parameters:
nonAtomic- if the post-processing step will prevent MongoDB from locking the database.- Returns:
- this
- MongoDB documentation
- output with an action
-
isNonAtomic
@Deprecated public java.lang.Boolean isNonAtomic()
Deprecated.
-
setBypassDocumentValidation
public MapReduceOptions setBypassDocumentValidation(java.lang.Boolean bypassDocumentValidation)
Sets the bypass document level validation flag.Note: This only applies when an $out stage is specified
.- Parameters:
bypassDocumentValidation- If true, allows the write to opt-out of document level validation.- Returns:
- this
- Since:
- 1.2
- Since server release
- 3.2
- MongoDB documentation
- Aggregation
-
isBypassDocumentValidation
public java.lang.Boolean isBypassDocumentValidation()
-
setCollation
public MapReduceOptions setCollation(Collation collation)
Sets the collation optionsA null value represents the server default.
- Parameters:
collation- the collation options to use- Returns:
- this
- Since:
- 1.3
- Since server release
- 3.4
-
getCollation
public Collation getCollation()
-
setBatchSize
public MapReduceOptions setBatchSize(java.lang.Integer batchSize)
Sets the number of documents to return per batch.Overrides the
Subscription.request(long)value for setting the batch size, allowing for fine grained control over the underlying cursor.- Parameters:
batchSize- the batch size- Returns:
- this
- Since:
- 1.8
- MongoDB documentation
- Batch Size
-
getBatchSize
public java.lang.Integer getBatchSize()
-
-