views:

25

answers:

1

I would like to know how I can reproduce 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')
A: 

It's a basic case of MapReduce. You can see documentation about that :

http://www.mongodb.org/display/DOCS/MapReduce

shingara