Is there a way to pass through "find" before map_reduce for MongoDB?
The following line works:
Analytic.collection.map_reduce(map, reduce).find
but is there a way to do
Analytic.collection.find('page_type' => 'products').map_reduce(map, reduce).find
and even filter a date range such as date >= "201开发者_StackOverflow社区0-08-01" and date <= "2010-08-31"
?
Use the query option (see http://www.mongodb.org/display/DOCS/MapReduce#MapReduce-Overview). Any normal query will work, so yes, you can do a date range.
精彩评论