开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜