【问题标题】:MapReduce in MongoDB: Changing the document structure of the reduction collectionMongoDB 中的 MapReduce:更改归约集合的文档结构
【发布时间】:2012-02-13 19:16:15
【问题描述】:

也许这只是我缺少的东西,但是有什么方法可以改变 map reduce 的结构在新集合中出现的方式?例如,目前我有:

{ "_id" : id_for_item,
  "value" : { "item1" : 10,
              "item2" : 12,
              "item3" : 19
            } 
}

但我想要类似的东西:

{ "_id" : id_for_item,
  "item1" : 10,
  "item2" : 12,
  "item3" : 19
}

任何帮助将不胜感激。

【问题讨论】:

    标签: javascript json mongodb mapreduce


    【解决方案1】:

    不,目前不可能。但是有一个jira案例here。您可以投票并等待。但它肯定不会很快完成,因为甚至没有计划。

    如果您通过任何驱动程序访问数据库,您可以创建将 m/r 结果映射到所需结构的方法。

    【讨论】:

      猜你喜欢
      • 2014-06-01
      • 1970-01-01
      • 2012-06-29
      • 1970-01-01
      • 1970-01-01
      • 2019-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多