I created a small test database in CouchDB and I'm creating a temporary view in Futon. I wrote the mapper and the reducer. The mapper works, but the check box for the reducer never shows up. I know that there should be a check box because I've seen it when playing with views on a larger database I have.
Why is the reducer check box not present? Is this normal behavior? Does the reducer check box sometimes not appear? Maybe it's because my result set is small or can't be reduced for some reason? (though I see no reason why I shouldn't be able to reduce the results I have)
My mapper is this. I added the [1, 2, 3].forEach
thing just because I thought I needed to make the result set larger in order to get the reduce check box.
function(doc) {
[1, 2, 3].forEach(function() {
emit(doc.name, 1);
});
}
The reducer is this.
function(keys, values, rereduce) {
return sum(values);
}
The results look like this: