Skip to content

Commit

Permalink
Functioning reduce (and rereduce) function for meals-by-month
Browse files Browse the repository at this point in the history
  • Loading branch information
eee-c committed Jul 19, 2009
1 parent 2527767 commit 2d8df93
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion couch/_design/meals/views/by_month/reduce.js
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
function(keys, values, rereduce) { return values; }
function(keys, values, rereduce) {
if (rereduce) {
var a = [];
for (var i=0; i<values.length; i++) {
for (var j=0; j<values[i].length; j++) {
a.push(values[i][j]);
}
}
return a;
}
else {
return values;
}
}

0 comments on commit 2d8df93

Please sign in to comment.