java.lang.Object | |
↳ | com.mongodb.MapReduceCommand |
This class groups the argument for a map/reduce operation and can build the underlying command object
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MapReduceCommand.OutputType | INLINE - Return results inline, no result is written to the DB server REPLACE - Save the job output to a collection, replacing its previous content MERGE - Merge the job output with the existing contents of outputTarget collection REDUCE - Reduce the job output with the existing contents of outputTarget collection |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Represents the command for a map reduce operation
Runs the command in REPLACE output type to a named collection@return
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the Finalize JS Function
| |||||||||||
Get the name of the collection the MapReduce will read from
| |||||||||||
Gets the (optional) limit on input
| |||||||||||
Get the map function, as a JS String
| |||||||||||
Gets the output target (name of collection to save to)
This value is nullable only if OutputType is set to INLINE
| |||||||||||
Gets the OutputType for this instance.
| |||||||||||
Gets the query to run for this MapReduce job
| |||||||||||
Gets the read preference
| |||||||||||
Gets the reduce function, as a JS String
| |||||||||||
Gets the (optional) JavaScript scope
| |||||||||||
Gets the (optional) sort specification object
| |||||||||||
Gets the verbosity of the MapReduce job.
| |||||||||||
Sets the Finalize JS Function
| |||||||||||
Sets the (optional) limit on input
| |||||||||||
Sets the (optional) database name where the output collection should reside
| |||||||||||
Sets the read preference for this command.
| |||||||||||
Sets the (optional) JavaScript scope
| |||||||||||
Sets the (optional) sort specification object
| |||||||||||
Sets the verbosity of the MapReduce job,
defaults to 'true'
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection@return
inputCollection | the collection to read from |
---|---|
map | map function in javascript code |
reduce | reduce function in javascript code |
outputCollection | optional - leave null if want to get the result inline |
type | the type of output |
query | the query to use on input |
MongoException | |
MongoException |
Gets the Finalize JS Function
Get the name of the collection the MapReduce will read from
Gets the (optional) limit on input
Get the map function, as a JS String
Gets the output target (name of collection to save to) This value is nullable only if OutputType is set to INLINE
Gets the OutputType for this instance.
Gets the reduce function, as a JS String
Gets the (optional) JavaScript scope
Sets the Finalize JS Function
finalize | The finalize function (as a JS String) |
---|
Sets the (optional) limit on input
limit | The limit specification object |
---|
Sets the (optional) database name where the output collection should reside
Sets the read preference for this command.
See the * documentation for ReadPreference
for more information.
preference | Read Preference to use |
---|
Sets the (optional) JavaScript scope
scope | The JavaScript scope |
---|
Sets the (optional) sort specification object
sort | The sort specification object |
---|
Sets the verbosity of the MapReduce job, defaults to 'true'
verbose | The verbosity level. |
---|