activerecord query as map reduce in mongodb
I would like to know how I can reproduce开发者_Python百科 the following query as map reduce or any juice function from MongoMapper or MongoID:
Event.find(:all,:select=>'events.company,SUM(price) as total_price',
:group=> 'company',:order => ' total_price DESC, created_at DESC')
It's a basic case of MapReduce. You can see documentation about that :
http://www.mongodb.org/display/DOCS/MapReduce
精彩评论