Skip to content

Commit

Permalink
Reordered some functions in the stats design doc, for demo purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wood committed Aug 9, 2010
1 parent e24f710 commit b6fe2d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stats_design_doc.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"_id": "_design/stats",
"views": {
"by_lastname": {
"map": "function(doc) { emit(doc.last_name, null); }"
},
"total_employees": {
"map": "function(doc) { emit(doc._id, 1); }",
"reduce": "function(keys, values, rereduce) { return sum(values); }"
},
"total_payroll": {
"map": "function(doc) { emit(doc._id, doc.salary); }",
"reduce": "_sum"
"by_lastname": {
"map": "function(doc) { emit(doc.last_name, null); }"
},
"dependents": {
"map": "function(doc) { if (doc.dependents) { for (i in doc.dependents) { emit(doc._id, doc.dependents[i]); } } }",
"reduce": "_count"
},
"total_payroll": {
"map": "function(doc) { emit(doc._id, doc.salary); }",
"reduce": "_sum"
},
"by_date_hired": {
"map": "function(doc) { year = parseInt(doc.date_hired.substr(0,4)); month = parseInt(doc.date_hired.substr(5,2)); day = parseInt(doc.date_hired.substr(8,2)); emit([year,month,day], null); }"
}
Expand Down

0 comments on commit b6fe2d8

Please sign in to comment.