Package com.mongodb
Class MapReduceOutput
- java.lang.Object
-
- com.mongodb.MapReduceOutput
-
public class MapReduceOutput extends Object
Represents the result of a map/reduce operation. Users should interact with the results of the map reduce via the results() method, or by interacting directly with the collection the results were input into.- MongoDB documentation
- Map-Reduce
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drop()
Drops the collection that holds the results.String
getCollectionName()
Get the name of the collection that the results of the map reduce were saved into.DBObject
getCommand()
Get the original command that was sent to the database.String
getDatabaseName()
Get the name of the database that the results of the map reduce were saved into.int
getDuration()
Get the amount of time, in milliseconds, that it took to run this map reduce.int
getEmitCount()
Get the number of messages emitted from the provided map function.int
getInputCount()
Get the number of documents that were input into the map reduce operationDBCollection
getOutputCollection()
Gets the collection that holds the results (Will return null if results are Inline).int
getOutputCount()
Get the number of documents generated as a result of this map reduceIterable<DBObject>
results()
Returns an iterable containing the results of the operation.String
toString()
-
-
-
Method Detail
-
results
public Iterable<DBObject> results()
Returns an iterable containing the results of the operation.- Returns:
- the results in iterable form
-
drop
public void drop()
Drops the collection that holds the results. Does nothing if the map-reduce returned the results inline.
-
getOutputCollection
@Nullable public DBCollection getOutputCollection()
Gets the collection that holds the results (Will return null if results are Inline).- Returns:
- the collection or null
-
getCommand
public DBObject getCommand()
Get the original command that was sent to the database.- Returns:
- a DBObject containing the values of the original map-reduce command.
-
getCollectionName
@Nullable public final String getCollectionName()
Get the name of the collection that the results of the map reduce were saved into. If the map reduce was an inline operation (i.e . the results were returned directly from calling the map reduce) this will return null.- Returns:
- the name of the collection that the map reduce results are stored in
-
getDatabaseName
public String getDatabaseName()
Get the name of the database that the results of the map reduce were saved into. If the map reduce was an inline operation (i.e . the results were returned directly from calling the map reduce) this will return null.- Returns:
- the name of the database that holds the collection that the map reduce results are stored in
-
getDuration
public int getDuration()
Get the amount of time, in milliseconds, that it took to run this map reduce.- Returns:
- an int representing the number of milliseconds it took to run the map reduce operation
-
getInputCount
public int getInputCount()
Get the number of documents that were input into the map reduce operation- Returns:
- the number of documents that read while processing this map reduce
-
getOutputCount
public int getOutputCount()
Get the number of documents generated as a result of this map reduce- Returns:
- the number of documents output by the map reduce
-
getEmitCount
public int getEmitCount()
Get the number of messages emitted from the provided map function.- Returns:
- the number of items emitted from the map function
-
-