Mongo DB mapReduce():E查询[js] TypeError:c.out未定义

问题描述 投票:0回答:1

当我打电话给mapReduce时:

// the body of the map and reduce function is not important, suppose we already defined it
db.my_collection.mapReduce(map, reduce,{})

我收到一个错误:

2019-12-11T09:58:05.492+0800 E QUERY    [js] TypeError: c.out is undefined :
DBCollection.prototype.mapReduce@src/mongo/shell/collection.js:1135:1

这是什么意思?

javascript mongodb mapreduce
1个回答
0
投票

您必须为out指定一些名称,无论是集合名称还是内联

db.active_user_behavior.mapReduce(map, reduce, { out: { inline:1 } })
© www.soinside.com 2019 - 2024. All rights reserved.