MapReduce中的Golang GlobalSign mgo查询

import "github.com/globalsign/mgo"

job := &mgo.MapReduce{
    Map:    "function() { emit(this.name, 1) }",
    Reduce: "function(key, values) { return Array.sum(values) }",
    Out:    "res",

}

_, err = c.Find(nil).MapReduce(job, nil)

How to add 'query' to the above golang mgo mapreduce ?

Ref:

https://docs.mongodb.com/manual/core/map-reduce/ https://godoc.org/github.com/globalsign/mgo#MapReduce

查看全部
duanfu3597
duanfu3597
2019/07/17 12:44
  • mapreduce
  • mongodb
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复