我正在尝试在大量文档中使用map-reduce,其中每个文档都有一些我想要收集到数组中的字段。 (每个字段类型的数组)。我认为map-reduce是这项工作的正确模式,但我收到以下错误:
planSummary: COUNT keysExamined:0 docsExamined:0 exception: value too large to reduce
code:13070 numYields:3025579 reslen:98 locks:{ Global: { acquireCount: { r: 17765206, w: 5104556 } },
Database: { acquireCount: { r: 1627, w: 5104550, R: 6328698, W: 9 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 382 } },
Collection: { acquireCount: { r: 1627, w: 5104553 } } } protocol:op_command 64490380ms
关于如何调试或强制它工作的任何想法?
**编辑** 添加map和reduce函数以及文档的一般构建。
var map = function() { key = [this.k1, this.k2, this.k3]; emit(key, this); };
var red = function(key, documents){
var result = documents[0];
var x1 = [result.x1];
...
var xn = [result.xn];
for (i = 1; i < documents.length; i++){
x1.push(documents[i].x1);
...
xn.push(documents[i].xn);
}
result.x1 = x1;
...
result.xn = xn;
return result;
};
我不能放置样本对象,但是它们构建为3个字段是键,其他值是应该成为列表的值,如reduce函数中所做的那样。
由于