Mongodb Java MapReduce getOutputCollection



我对输出类型一无所知。我正在尝试这样的事情:

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

但由于内联输出类型,该集合为 null。我需要减少的集合,因为我需要进一步减少它。我该怎么做?

我终于找到了解决这个问题的方法

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

请注意,您不能一次又一次地存储在同一个目标"mymap"中。当你像"mymap".concat(Integer.toString(i))一样循环时,你必须使用不同的名称

相关内容

  • 没有找到相关文章

最新更新