Changeset 382 for Dev/branches/rest-dojo-ui/client/config
- Timestamp:
- 07/27/12 14:52:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/config/docs.json
r375 r382 54 54 "_id": "q4", 55 55 "title": "Rate your experience at your current employer from 1 to 10.", 56 "categories": [57 "Respondent personals",58 "Professional background"59 ],60 "topic": "Work enjoyment",61 56 "type": "Question" 62 57 }, … … 74 69 }, 75 70 "questions": { 76 "map": "function(doc){ if ( doc.type === 'Question' ) { for (var i = 0; i < doc.categories.length; i++) { emit([doc.categories[i],doc.topic],1); } } }",71 "map": "function(doc){ if ( doc.type === 'Question' ) { if ( doc.categories && doc.categories.length > 0 ) { for (var i = 0; i < doc.categories.length; i++) { emit([doc.categories[i],doc.topic || '[No topic]'],1); } } else { emit(['[No category]','[No topic]'],1); } } }", 77 72 "reduce": "function(keys,values) { return sum(values); }" 78 73 },
Note: See TracChangeset
for help on using the changeset viewer.