【发布时间】:2011-08-21 12:08:48
【问题描述】:
我需要在 mongo db 的集合中找到重复项,该集合包含大约 20000 个文档。结果应该给我密钥(我正在分组)以及它们仅在计数大于 1 时重复的次数。以下内容不完整,但是当我在 mongo 中运行时也会出错。 exe外壳:
db.runCommand({ mapreduce: users,
map : function Map() {
emit(this.emailId, 1);
}
reduce : function Reduce(key, vals) {
return Array.sum(vals);
}
finalize : function Finalize(key, reduced) {
return reduced
}
out : { inline : 1 }
});
SyntaxError: missing } after property list (shell):5
为什么会出现上述错误? 怎么只能得到count大于1的呢?
【问题讨论】:
标签: mongodb