MapReduce with MongoMapper Comments http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments MapReduce with MongoMapper Sat, 19 May 2012 01:19:43 GMT Comment by John Nunemaker on Sun Aug 01 2010 21:32:34 GMT+0000 (UTC) Thanks for posting. One thing I have seen people do is move each map/reduce to its own class. Something like this: class PageViewsByMonth def self.map <<-MAP function() {…} MAP end def self.reduce <<-REDUCE function() {…} REDUCE end def self.build Views.collection.map_reduce(map, reduce) end end http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4c5626ac75fd7f029e000003 http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4c5626ac75fd7f029e000003 Sun, 01 Aug 2010 21:32:34 GMT Comment by Chris Umbel on Mon Aug 02 2010 02:02:54 GMT+0000 (UTC) Great, thanks John! http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4c56274e75fd7f029e000006 http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4c56274e75fd7f029e000006 Mon, 02 Aug 2010 02:02:54 GMT Comment by chrisumbel on Sun Sep 05 2010 13:05:48 GMT+0000 (UTC) I couldn't help it. I updated the example to match John's style. http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4c8395ac75fd7f06fd000010 http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4c8395ac75fd7f06fd000010 Sun, 05 Sep 2010 13:05:48 GMT Comment by Chris Barretto on Fri Dec 10 2010 09:02:56 GMT+0000 (UTC) Great stuff on m/r. I have a very large data set of hundreds of millions of documents that are basically Events that are logged from impressions. The Events have a field called Publisher and I break this large collection down into smaller manageable collections via the mongo command line that are named pub.<name of publisher>. Any recommendation on how I can access those using MongoMapper? I also further map reduce those publisher collections down to unique tables as well as other aggregations that happen on a nightly cron. Any thought on accessing those through the app? Again, awesome post dude! http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4d01ecc0b2ee2f03f100012d http://www.chrisumbel.com/article/map_reduce_mongodb_mongomapper_rails#comments_4d01ecc0b2ee2f03f100012d Fri, 10 Dec 2010 09:02:56 GMT