当我打电话给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
这是什么意思?
您必须为out
指定一些名称,无论是集合名称还是内联
db.active_user_behavior.mapReduce(map, reduce, { out: { inline:1 } })