couchrest_model/lib/couchrest/helper/templates/example-reduce.js
2008-09-16 11:15:00 -04:00

10 lines
200 B
JavaScript

// example reduce function to count the
// number of rows in a given key range.
function(keys, value, rereduce) {
if (rereduce) {
return sum(values);
} else {
return values.length;
}
};