Package com.mongodb
Class MapReduceCommand
java.lang.Object
com.mongodb.MapReduceCommand
Deprecated.
Superseded by aggregate
This class groups the argument for a map/reduce operation and can build the underlying command object
- MongoDB documentation
- Map-Reduce
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumDeprecated.Represents the different options available for outputting the results of a map-reduce operation.
- 
Constructor SummaryConstructorsConstructorDescriptionMapReduceCommand(DBCollection inputCollection, String map, String reduce, String outputCollection, MapReduceCommand.OutputType type, DBObject query) Deprecated.Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated.Gets whether to bypass document validation, or null if unspecified.Deprecated.Returns the collationDeprecated.Gets the Finalize JS FunctiongetInput()Deprecated.Get the name of the collection the MapReduce will read fromDeprecated.Gets the (optional) JavaScript modeintgetLimit()Deprecated.Gets the (optional) limit on inputgetMap()Deprecated.Get the map function, as a JS StringlonggetMaxTime(TimeUnit timeUnit) Deprecated.Gets the max execution time for this command, in the given time unit.Deprecated.Gets the (optional) database name where the output collection should resideDeprecated.Gets the output target (name of collection to save to) This value is nullable only if OutputType is set to INLINEDeprecated.Gets the OutputType for this instance.getQuery()Deprecated.Gets the query to run for this MapReduce jobDeprecated.Gets the read preferenceDeprecated.Gets the reduce function, as a JS StringgetScope()Deprecated.Gets the (optional) JavaScript scopegetSort()Deprecated.Gets the (optional) sort specification objectDeprecated.Gets the verbosity of the MapReduce job.voidsetBypassDocumentValidation(Boolean bypassDocumentValidation) Deprecated.Sets whether to bypass document validation.voidsetCollation(Collation collation) Deprecated.Sets the collation optionsvoidsetFinalize(String finalize) Deprecated.Sets the Finalize JS FunctionvoidDeprecated.Sets the (optional) JavaScript ModevoidsetLimit(int limit) Deprecated.Sets the (optional) limit on inputvoidsetMaxTime(long maxTime, TimeUnit timeUnit) Deprecated.Sets the max execution time for this command, in the given time unit.voidsetOutputDB(String outputDB) Deprecated.Sets the (optional) database name where the output collection should residevoidsetReadPreference(ReadPreference preference) Deprecated.Sets the read preference for this command.voidDeprecated.Sets the (optional) JavaScript scopevoidDeprecated.Sets the (optional) sort specification objectvoidsetVerbose(Boolean verbose) Deprecated.Sets the verbosity of the MapReduce job, defaults to 'true'Deprecated.Turns this command into a DBObject representation of this map reduce command.toString()Deprecated.
- 
Constructor Details- 
MapReduceCommandpublic MapReduceCommand(DBCollection inputCollection, String map, String reduce, @Nullable String outputCollection, MapReduceCommand.OutputType type, DBObject query) Deprecated.Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection- Parameters:
- inputCollection- collection to use as the source documents to perform the map reduce operation.
- map- a JavaScript function that associates or "maps" a value with a key and emits the key and value pair.
- reduce- a JavaScript function that "reduces" to a single object all the values associated with a particular key.
- outputCollection- optional - leave null if want to get the result inline
- type- the type of output
- query- specifies the selection criteria using query operators for determining the documents input to the map function.
- MongoDB documentation
- Map Reduce Command
 
 
- 
- 
Method Details- 
setVerboseDeprecated.Sets the verbosity of the MapReduce job, defaults to 'true'- Parameters:
- verbose- The verbosity level.
 
- 
isVerboseDeprecated.Gets the verbosity of the MapReduce job.- Returns:
- the verbosity level.
 
- 
getInputDeprecated.Get the name of the collection the MapReduce will read from- Returns:
- name of the collection the MapReduce will read from
 
- 
getMapDeprecated.Get the map function, as a JS String- Returns:
- the map function (as a JS String)
 
- 
getReduceDeprecated.Gets the reduce function, as a JS String- Returns:
- the reduce function (as a JS String)
 
- 
getOutputTargetDeprecated.Gets the output target (name of collection to save to) This value is nullable only if OutputType is set to INLINE- Returns:
- The outputCollection
 
- 
getOutputTypeDeprecated.Gets the OutputType for this instance.- Returns:
- The outputType.
 
- 
getFinalizeDeprecated.Gets the Finalize JS Function- Returns:
- The finalize function (as a JS String).
 
- 
setFinalizeDeprecated.Sets the Finalize JS Function- Parameters:
- finalize- The finalize function (as a JS String)
 
- 
getQueryDeprecated.Gets the query to run for this MapReduce job- Returns:
- The query object
 
- 
getSortDeprecated.Gets the (optional) sort specification object- Returns:
- the Sort DBObject
 
- 
setSortDeprecated.Sets the (optional) sort specification object- Parameters:
- sort- The sort specification object
 
- 
getLimitpublic int getLimit()Deprecated.Gets the (optional) limit on input- Returns:
- The limit specification object
 
- 
setLimitpublic void setLimit(int limit) Deprecated.Sets the (optional) limit on input- Parameters:
- limit- The limit specification object
 
- 
getMaxTimeDeprecated.Gets the max execution time for this command, in the given time unit.- Parameters:
- timeUnit- the time unit to return the value in.
- Returns:
- the maximum execution time
- Since:
- 2.12.0
 
- 
setMaxTimeDeprecated.Sets the max execution time for this command, in the given time unit.- Parameters:
- maxTime- the maximum execution time. A non-zero value requires a server version >= 2.6
- timeUnit- the time unit that maxTime is specified in
- Since:
- 2.12.0
 
- 
getScopeDeprecated.Gets the (optional) JavaScript scope- Returns:
- The JavaScript scope
 
- 
setScopeDeprecated.Sets the (optional) JavaScript scope- Parameters:
- scope- The JavaScript scope
 
- 
getJsModeDeprecated.Gets the (optional) JavaScript mode- Returns:
- The JavaScript mode
- Since:
- 2.13
 
- 
setJsModeDeprecated.Sets the (optional) JavaScript Mode- Parameters:
- jsMode- Specifies whether to convert intermediate data into BSON format between the execution of the map and reduce functions
- Since:
- 2.13
 
- 
getOutputDBDeprecated.Gets the (optional) database name where the output collection should reside- Returns:
- the name of the database the result is stored in, or null.
 
- 
setOutputDBDeprecated.Sets the (optional) database name where the output collection should reside- Parameters:
- outputDB- the name of the database to send the Map Reduce output to
 
- 
getBypassDocumentValidationDeprecated.Gets whether to bypass document validation, or null if unspecified. The default is null.- Returns:
- whether to bypass document validation, or null if unspecified.
- Since:
- 2.14
- Since server release
- 3.2
 
- 
setBypassDocumentValidationDeprecated.Sets whether to bypass document validation.- Parameters:
- bypassDocumentValidation- whether to bypass document validation, or null if unspecified
- Since:
- 2.14
- Since server release
- 3.2
 
- 
toDBObjectDeprecated.Turns this command into a DBObject representation of this map reduce command.- Returns:
- a DBObject that contains the MongoDB document representation of this command.
 
- 
setReadPreferenceDeprecated.Sets the read preference for this command. See the * documentation forReadPreferencefor more information.- Parameters:
- preference- Read Preference to use
 
- 
getReadPreferenceDeprecated.Gets the read preference- Returns:
- the readPreference
 
- 
getCollationDeprecated.Returns the collation- Returns:
- the collation
- Since:
- 3.4
- Since server release
- 3.4
 
- 
setCollationDeprecated.Sets the collation options- Parameters:
- collation- the collation options
- Since:
- 3.4
- Since server release
- 3.4
 
- 
toStringDeprecated.
 
-