* @param result the {@link MapReduceOutput}
*/
public MapReduceResult(MapReduceOutput output) {
this.resultCollection = output.getOutputCollection();
CommandResult result = output.getCommandResult();
if (result.containsField("counts")) {
DBObject counts = (DBObject)result.get("counts");
this.numObjectsScanned = new Long(counts.get("input").toString());
this.numEmits = new Long(counts.get("emit").toString());
this.numObjectsOutput = new Long(counts.get("output").toString());
}