couchrest_model/lib/couchrest/helper/app-template/views/example/reduce.js

10 lines
201 B
JavaScript
Raw Normal View History

2008-09-16 17:15:00 +02:00
// example reduce function to count the
// number of rows in a given key range.
2008-09-16 18:10:45 +02:00
function(keys, values, rereduce) {
2008-09-16 17:15:00 +02:00
if (rereduce) {
return sum(values);
} else {
return values.length;
}
};