moved app template
This commit is contained in:
parent
9faa9daaca
commit
5d3e684c6a
11 changed files with 4 additions and 3 deletions
9
lib/couchrest/helper/app-template/views/example/map.js
Normal file
9
lib/couchrest/helper/app-template/views/example/map.js
Normal 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);
|
||||
};
|
10
lib/couchrest/helper/app-template/views/example/reduce.js
Normal file
10
lib/couchrest/helper/app-template/views/example/reduce.js
Normal 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;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue