moved app template

This commit is contained in:
Chris Anderson 2009-01-08 09:50:45 -08:00
parent 9faa9daaca
commit 5d3e684c6a
11 changed files with 4 additions and 3 deletions

View file

@ -0,0 +1,9 @@
// an example map function, emits the doc id
// and the list of keys it contains
// !require lib.helpers.math
function(doc) {
var k, keys = []
for (k in doc) keys.push(k);
emit(doc._id, keys);
};

View file

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