send object as value in map and reduce in mgo?

14 views
Skip to first unread message

Adusumilli SeshaChandra

unread,
Feb 24, 2015, 6:41:46 AM2/24/15
to mgo-...@googlegroups.com
can we send  complete "this" object as value in emit function of map or it should be some property of "this" object in MapandReduce of mgo?? 

Gustavo Niemeyer

unread,
Feb 24, 2015, 8:35:22 AM2/24/15
to mgo-...@googlegroups.com
The map/reduce functionality is implemented by the server, so the same
rules apply to all drivers. I suggest having a look at the server
documentation, which has details and examples on it:

http://docs.mongodb.org/manual/core/map-reduce/
http://docs.mongodb.org/manual/tutorial/map-reduce-examples/

I would also strongly recommend using the aggregation framework
instead of the map/reduce functionality, if you can:

http://gopkg.in/mgo.v2#Collection.Pipe
http://docs.mongodb.org/manual/core/aggregation-pipeline/
> --
> You received this message because you are subscribed to the Google Groups
> "mgo-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mgo-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

gustavo @ http://niemeyer.net
Reply all
Reply to author
Forward
0 new messages