|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mongodb.MapReduceCommand
public class MapReduceCommand
This class groups the argument for a map/reduce operation and can build the underlying command object
Nested Class Summary | |
---|---|
static class |
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 |
Constructor Summary | |
---|---|
MapReduceCommand(DBCollection inputCollection,
java.lang.String map,
java.lang.String reduce,
java.lang.String outputCollection,
MapReduceCommand.OutputType type,
DBObject query)
Represents the command for a map reduce operation Runs the command in REPLACE output type to a named collection |
Method Summary | |
---|---|
void |
addExtraOption(java.lang.String name,
java.lang.Object value)
|
DBObject |
getExtraOptions()
|
java.lang.String |
getFinalize()
Gets the Finalize JS Function |
java.lang.String |
getInput()
Get the name of the collection the MapReduce will read from |
int |
getLimit()
Gets the (optional) limit on input |
java.lang.String |
getMap()
Get the map function, as a JS String |
java.lang.String |
getOutputTarget()
Gets the output target (name of collection to save to) This value is nullable only if OutputType is set to INLINE |
MapReduceCommand.OutputType |
getOutputType()
Gets the OutputType for this instance. |
DBObject |
getQuery()
Gets the query to run for this MapReduce job |
java.lang.String |
getReduce()
Gets the reduce function, as a JS String |
java.util.Map<java.lang.String,java.lang.Object> |
getScope()
Gets the (optional) JavaScript scope |
DBObject |
getSort()
Gets the (optional) sort specification object |
java.lang.Boolean |
isVerbose()
Gets the verbosity of the MapReduce job. |
void |
setFinalize(java.lang.String finalize)
Sets the Finalize JS Function |
void |
setLimit(int limit)
Sets the (optional) limit on input |
void |
setOutputDB(java.lang.String outputDB)
Sets the (optional) database name where the output collection should reside |
void |
setScope(java.util.Map<java.lang.String,java.lang.Object> scope)
Sets the (optional) JavaScript scope |
void |
setSort(DBObject sort)
Sets the (optional) sort specification object |
void |
setVerbose(java.lang.Boolean verbose)
Sets the verbosity of the MapReduce job, defaults to 'true' |
DBObject |
toDBObject()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MapReduceCommand(DBCollection inputCollection, java.lang.String map, java.lang.String reduce, java.lang.String outputCollection, MapReduceCommand.OutputType type, DBObject query) throws MongoException
inputCollection
- the collection to read frommap
- map function in javascript codereduce
- reduce function in javascript codeoutputCollection
- optional - leave null if want to get the result inlinetype
- the type of outputquery
- the query to use on input
MongoException
Method Detail |
---|
public void setVerbose(java.lang.Boolean verbose)
verbose
- The verbosity level.public java.lang.Boolean isVerbose()
public java.lang.String getInput()
public java.lang.String getMap()
public java.lang.String getReduce()
public java.lang.String getOutputTarget()
public MapReduceCommand.OutputType getOutputType()
public java.lang.String getFinalize()
public void setFinalize(java.lang.String finalize)
finalize
- The finalize function (as a JS String)public DBObject getQuery()
public DBObject getSort()
public void setSort(DBObject sort)
sort
- The sort specification objectpublic int getLimit()
public void setLimit(int limit)
limit
- The limit specification objectpublic java.util.Map<java.lang.String,java.lang.Object> getScope()
public void setScope(java.util.Map<java.lang.String,java.lang.Object> scope)
scope
- The JavaScript scopepublic void setOutputDB(java.lang.String outputDB)
outputDB
- public DBObject toDBObject()
public void addExtraOption(java.lang.String name, java.lang.Object value)
public DBObject getExtraOptions()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |