You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by wh...@aol.com on 2010/08/10 21:35:53 UTC

using a list to send the raw json

How do I use mylist below  to put the raw json from a view into
a javascript variable?


Here's my code

{
   "_id": "_design/view1",
   "_rev": "26-ee46c5c8dfc2318eab327578b1740a7f",
   "language": "javascript",
   "views": {
       "myview": {
           "map": "function(doc) {\u000a  emit(doc.title, doc.body);\u000a}"
       }
   },
   "shows": {
       "myshow": "function(doc, req) { return {    body :'test',    headers : {     'Content-Type' : 'text/html'   }  }}"
   },
   "lists": {
       "mylist": "function(head, req) {var row; start({    'headers': {     'Content-Type': 'text/html'    }  });while(row = getRow()) {send('<br>'+row.value); }}"
   }
}

Thanks,

Dan