开发者

Is there a way to pass through "find" before map_reduce for MongoDB?

开发者 https://www.devze.com 2023-01-16 18:47 出处:网络
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

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.

0

精彩评论

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