gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 10:43:46 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com