开发者

activerecord query as map reduce in mongodb

开发者 https://www.devze.com 2023-01-20 10:53 出处:网络
I would like to know how I can reproduce开发者_Python百科 the following query as map reduce or any juice function from MongoMapper or MongoID:

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

精彩评论

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