map

function(){emit(null,2);}

reduce

function(key, values, rereduce)
{
var response = {"a": 0};
for(i=0; i<values.length; i++)
{
if (rereduce)
{
response.a = response.a + values[i].a;
}
else
{
response.a+=values[i];
}
}
return response;
}

posted on 2017-12-26 23:08  rosanshao  阅读(119)  评论(0编辑  收藏  举报