diff --git a/lib/couchrest/helper/templates/example-map.js b/lib/couchrest/helper/templates/example-map.js new file mode 100644 index 0000000..878684d --- /dev/null +++ b/lib/couchrest/helper/templates/example-map.js @@ -0,0 +1,8 @@ +// an example map function, emits the doc id +// and the list of keys it contains + +function(doc) { + var k, keys = [] + for (k in doc) keys.push(k); + emit(doc._id, keys); +}; diff --git a/lib/couchrest/helper/templates/example-reduce.js b/lib/couchrest/helper/templates/example-reduce.js new file mode 100644 index 0000000..23f61c5 --- /dev/null +++ b/lib/couchrest/helper/templates/example-reduce.js @@ -0,0 +1,10 @@ +// 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; + } +}; \ No newline at end of file diff --git a/lib/couchrest/helper/templates/index.html b/lib/couchrest/helper/templates/index.html new file mode 100644 index 0000000..5e48e98 --- /dev/null +++ b/lib/couchrest/helper/templates/index.html @@ -0,0 +1,26 @@ + + + + Generated CouchApp + + + +

Generated CouchApp

+ + + + + + + \ No newline at end of file