开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜