{ "_users/rft_admin": { "__configAction": "ignore", "_id": "org.couchdb.user:rft_admin", "name": "rft_admin", "password": "Welkom01", "roles": [ "rft_admin" ], "type": "user" }, "rft/_security": { "__configAction": "ignore", "admins" : { "names" : [], "roles" : ["rft_admin"] }, "readers" : { "names" : [], "roles" : ["rft_user"] } }, "rft/q1": { "__configAction": "update", "_id": "q1", "title": "How long have you worked here?", "categories": [ "Professional background" ], "topic": "Work experience", "type": "Question" }, "rft/q2": { "__configAction": "update", "_id": "q2", "title": "How many years have you been employed here?", "categories": [ "Respondent personals", "Professional background" ], "topic": "Work experience", "type": "Question" }, "rft/q3": { "__configAction": "update", "_id": "q3", "title": "Have you worked here longer than 10 years?", "categories": [ "Respondent personals" ], "topic": "Work experience", "type": "Question" }, "rft/q4": { "__configAction": "update", "_id": "q4", "title": "Rate your experience at your current employer from 1 to 10.", "categories": [ "Respondent personals", "Professional background" ], "topic": "Work enjoyment", "type": "Question" }, "rft/_design/default": { "__configAction": "replace", "_id": "_design/default", "language": "javascript", "validate_doc_update": "function(newDoc, oldDoc, userCtx, secObj) { if (oldDoc && oldDoc.published) { throw({forbidden: 'Published documents cannot be modified.'}); } }", "views": { "by_type": { "map": "function(doc){ emit(doc.type, doc); }" }, "unpublished": { "map": "function(doc){ if ( doc.type === 'Survey' && !doc.published ) { emit(doc._id, doc); } }" }, "questions": { "map": "function(doc){ if ( doc.type === 'Question' ) { for (var i = 0; i < doc.categories.length; i++) { emit([doc.categories[i],doc.topic],1); } } }", "reduce": "function(keys,values) { return sum(values); }" } } } }