couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hank Knight <hknight...@gmail.com>
Subject CouchDB: JavaScript functions inside show functions
Date Sun, 19 Jan 2014 17:35:29 GMT
How can I add a JavaScript function to a show function?
'XYZ: '+ (111*2)

I would like to reference a custom function like this:
'XYZ: '+ zooph(111)

This example does NOT work:

"myshowfunction": "function(doc, req){ return{'headers':
{'Content-Type' : 'text/plain'}, 'body': function zooph(x) {return
x*2;} + 'XYZ: '+ zooph(111)}}"

Mime
View raw message