java - MongoDB 的 Map Reduce OutputType 之间的差异

标签 java mongodb mapreduce output

我想使用 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/

相关文章:

java - 使用用户输入的面向对象编程

java - 如何构造查询来更新 mongo 中的嵌套数组文档?

mongodb - 在聚合之前匹配一组唯一字段的最新文档

java - 在hadoop中,如何获取值中的最后一个元素

java - MapReduce 2 作业在本地运行而不是提交到 yarn

即使答案应该是正确的,Java boolean 值也会返回 false

java - 如何在物联网边缘java模块中正确注册直接方法?

java - 将 JSON 解析为 MONGODB 文档

c# - 如何为大量文档取消设置字段?

java - 使用 Java 进行 Hadoop 多节点编程