2012-06-04 86 views
0

我对输出类型一无所知。我试图这样:Mongodb Java MapReduce getOutputCollection

output=collection.mapReduce(map,reduce,null, 
    MapReduceCommand.OutputType.INLINE,null); 
collection=output.getOutputCollection(); 

但由于INLINE输出类型,集合为空。我需要减少收集,因为我需要进一步减少它。我怎么能这样做?

回答

0

我找到了解决这个,你不能在同一个目标存储“MyMap中”一次又一次的最后

output=collection.mapReduce(map,reduce,"mymap",MapReduceCommand.OutputType. REDUCE,null); 
collection=output.getOutputCollection(); 

音符。当您循环使用时,您必须使用不同的名称,如"mymap".concat(Integer.toString(i))