|
||||||||||
| 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,
String map,
String reduce,
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(String name,
Object value)
|
DBObject |
getExtraOptions()
|
String |
getFinalize()
Gets the Finalize JS Function |
String |
getInput()
Get the name of the collection the MapReduce will read from |
int |
getLimit()
Gets the (optional) limit on input |
String |
getMap()
Get the map function, as a JS String |
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 |
ReadPreference |
getReadPreference()
Gets the read preference |
String |
getReduce()
Gets the reduce function, as a JS String |
Map<String,Object> |
getScope()
Gets the (optional) JavaScript scope |
DBObject |
getSort()
Gets the (optional) sort specification object |
Boolean |
isVerbose()
Gets the verbosity of the MapReduce job. |
void |
setFinalize(String finalize)
Sets the Finalize JS Function |
void |
setLimit(int limit)
Sets the (optional) limit on input |
void |
setOutputDB(String outputDB)
Sets the (optional) database name where the output collection should reside |
void |
setReadPreference(ReadPreference preference)
Sets the read preference for this command. |
void |
setScope(Map<String,Object> scope)
Sets the (optional) JavaScript scope |
void |
setSort(DBObject sort)
Sets the (optional) sort specification object |
void |
setVerbose(Boolean verbose)
Sets the verbosity of the MapReduce job, defaults to 'true' |
DBObject |
toDBObject()
|
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,
String map,
String reduce,
String outputCollection,
MapReduceCommand.OutputType type,
DBObject query)
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
| Method Detail |
|---|
public void setVerbose(Boolean verbose)
verbose - The verbosity level.public Boolean isVerbose()
public String getInput()
public String getMap()
public String getReduce()
public String getOutputTarget()
public MapReduceCommand.OutputType getOutputType()
public String getFinalize()
public void setFinalize(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 Map<String,Object> getScope()
public void setScope(Map<String,Object> scope)
scope - The JavaScript scopepublic void setOutputDB(String outputDB)
outputDB - public DBObject toDBObject()
public void addExtraOption(String name,
Object value)
public DBObject getExtraOptions()
public void setReadPreference(ReadPreference preference)
ReadPreference
for more information.
preference - Read Preference to usepublic ReadPreference getReadPreference()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||