我想使用 MongoDB 的 MapReduce 功能并访问大量数据。我正在使用
INLINE OutputType
MapReduceCommand cmd = new MapReduceCommand(dbCollection,
MapReduceTest.map,
MapReduceTest.reduce,
null,
MapReduceCommand.OutputType.INLINE,
query);
这在处理小数据集时工作正常,但它可用于处理高达 16MB 的数据,这对我来说是个问题。
我想访问一个非常大的数据集,但我还没有找到任何关于其他选项 MERGE、REDUCE、REPLACE
的好文档。
有谁知道区别吗?
最佳答案
这是来自官方文档的文本:
replace - Replace the contents of the if the collection with the collectionName exists.
merge - Merge the new result with the existing result if the output collection already exists. If an existing document has the same key as the new result, overwrite that existing document.
reduce - Merge the new result with the existing result if the output collection already exists. If an existing document has the same key as the new result, apply the reduce function to both the new and the existing documents and overwrite the existing document with the result.
引用: http://docs.mongodb.org/manual/reference/command/mapReduce/#output-to-a-collection-with-an-action
关于java - MongoDB 的 Map Reduce OutputType 之间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23521029/