chain mapreduce after pipe?

17 views
Skip to first unread message

Jiang Yu

unread,
Apr 21, 2016, 11:55:05 PM4/21/16
to mgo-users

how to run a aggregate and then apply a mapreduce in result?

pipe := []bson.D{...}

db.C(name).Pipe(pipe). ?

i knew that find query can chain mapreduce!

However pipe?

Žygimantas Stauga

unread,
Apr 22, 2016, 2:57:56 AM4/22/16
to mgo-users
https://docs.mongodb.org/manual/core/map-reduce/
There is no way to pipe some executed command results (find, aggregate, whatever) to map reduce. You can try store aggregation result in temporary collection, and then run map reduce there. Of course performance should be poor.

"i knew that find query can chain mapreduce!"
I think only query part are used.
Reply all
Reply to author
Forward
0 new messages