【问题标题】:Mongo DB mapReduce() : E QUERY [js] TypeError: c.out is undefinedMongo DB mapReduce() : E QUERY [js] TypeError: c.out is undefined
【发布时间】:2020-04-04 06:53:38
【问题描述】:

当我打电话给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】:

    您必须为out 指定一些内容,可以是集合名称或内联

    db.active_user_behavior.mapReduce(map, reduce, { out: { inline:1 } })
    

    【讨论】:

      猜你喜欢
      • 2018-05-17
      • 2020-07-20
      • 2011-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多