问题描述:

How can I use MapReduce in Ruby on Rails if I'm using the MongoDB Ruby driver?

网友答案:

Define your map and reduce js functions as variables, and then something along these lines:

activities = Connection.new(host,port).db(dbname).collection('activities')
activities.mapreduce(map,reduce,:out=>'analytics')

The 'analytics' collection will hold the result of the mapreduce operation.

相关阅读:
Top