Package io.quarkus.mongodb
Class MapReduceOptions
- java.lang.Object
-
- io.quarkus.mongodb.MapReduceOptions
-
public class MapReduceOptions extends Object
Map Reduce options.
-
-
Constructor Summary
Constructors Constructor Description MapReduceOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapReduceOptionsaction(com.mongodb.client.model.MapReduceAction action)Specify theMapReduceActionto be used when writing to a collection.<T> com.mongodb.reactivestreams.client.MapReducePublisher<T>apply(com.mongodb.reactivestreams.client.MapReducePublisher<T> stream)MapReduceOptionsbypassDocumentValidation(boolean bypassDocumentValidation)Sets the bypass document level validation flag.MapReduceOptionscollation(com.mongodb.client.model.Collation collation)Sets the collation optionsMapReduceOptionscollectionName(String collectionName)Sets the collectionName for the output of the MapReduceMapReduceOptionsdatabaseName(String databaseName)Sets the name of the database to output into.MapReduceOptionsfilter(org.bson.conversions.Bson filter)Sets the query filter to apply to the query.MapReduceOptionsfinalizeFunction(String finalizeFunction)Sets the JavaScript function that follows the reduce method and modifies the output.MapReduceOptionsjsMode(boolean jsMode)Sets the flag that specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions.MapReduceOptionslimit(int limit)Sets the limit to apply.MapReduceOptionsmaxTime(long maxTime, TimeUnit timeUnit)Sets the maximum execution time on the server for this operation.MapReduceOptionsnonAtomic(boolean nonAtomic)Sets if the post-processing step will prevent MongoDB from locking the database.MapReduceOptionsscope(org.bson.conversions.Bson scope)Sets the global variables that are accessible in the map, reduce and finalize functions.MapReduceOptionssharded(boolean sharded)Sets if the output database is shardedMapReduceOptionssort(org.bson.conversions.Bson sort)Sets the sort criteria to apply to the query.MapReduceOptionsverbose(boolean verbose)Sets whether to include the timing information in the result information.
-
-
-
Method Detail
-
collectionName
public MapReduceOptions collectionName(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
-
finalizeFunction
public MapReduceOptions finalizeFunction(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
-
scope
public MapReduceOptions scope(org.bson.conversions.Bson 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
-
sort
public MapReduceOptions sort(org.bson.conversions.Bson sort)
Sets the sort criteria to apply to the query.- Parameters:
sort- the sort criteria, which may be null.- Returns:
- this
-
filter
public MapReduceOptions filter(org.bson.conversions.Bson filter)
Sets the query filter to apply to the query.- Parameters:
filter- the filter to apply to the query.- Returns:
- this
-
limit
public MapReduceOptions limit(int limit)
Sets the limit to apply.- Parameters:
limit- the limit, which may be null- Returns:
- this
-
jsMode
public MapReduceOptions jsMode(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
-
verbose
public MapReduceOptions verbose(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
-
maxTime
public MapReduceOptions maxTime(long maxTime, TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.- Parameters:
maxTime- the max timetimeUnit- the time unit, which may not be null- Returns:
- this
-
action
public MapReduceOptions action(com.mongodb.client.model.MapReduceAction action)
Specify theMapReduceActionto be used when writing to a collection.- Parameters:
action- anMapReduceActionto perform on the collection- Returns:
- this
-
databaseName
public MapReduceOptions databaseName(String databaseName)
Sets the name of the database to output into.- Parameters:
databaseName- the name of the database to output into.- Returns:
- this
-
sharded
public MapReduceOptions sharded(boolean sharded)
Sets if the output database is sharded- Parameters:
sharded- if the output database is sharded- Returns:
- this
-
nonAtomic
public MapReduceOptions nonAtomic(boolean nonAtomic)
Sets if the post-processing step will prevent MongoDB from locking the database.Valid only with the
MapReduceAction.MERGEorMapReduceAction.REDUCEactions.- Parameters:
nonAtomic- if the post-processing step will prevent MongoDB from locking the database.- Returns:
- this
-
bypassDocumentValidation
public MapReduceOptions bypassDocumentValidation(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
-
collation
public MapReduceOptions collation(com.mongodb.client.model.Collation collation)
Sets the collation optionsA null value represents the server default.
- Parameters:
collation- the collation options to use- Returns:
- this
-
apply
public <T> com.mongodb.reactivestreams.client.MapReducePublisher<T> apply(com.mongodb.reactivestreams.client.MapReducePublisher<T> stream)
-
-