couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Reed <>
Subject Creating a permanent view
Date Wed, 20 Aug 2008 15:21:52 GMT
I've been poking around on the wiki site and googling for answers, but 
can't quite come up with the right syntax yet to create a permanent view 
and then GET the results.

I have a "test.view" file that looks like this:

    "all": {
      "map": "function(doc) { emit(doc.Patient, doc); 

Then I say:

curl -v -H 'Content-Type: application/json;' 
"http://localhost:5984/cs-cache/" --data-binary @/home/jreed/test.view

They I try to fire up:

And get a lengthy error message:

{"error":"EXIT","reason":"{function_clause,\n    [{couch_httpd,handle_db_request,\n      
{1,1},\n              {9,\n               {\"host\",\n                
{'Host',\"localhost:5984\"},\n                {\"accept\",\n                 
{'Accept',\n                     \"text\/html,application\/xhtml+xml,application\/xml;q=0.9,*\/*;q=0.8\"},\n
 nil,\n                 {\"accept-language\",\n                  
nil,nil},\n                   nil},\n                  {\"connection\",\n                
{'Connection',\"keep-alive\"},\n                   nil,\n                   
{\"cookie\",\n                    {'Cookie',\n                       
 \"sessionId=cca8e4b9-0de4-4d71-9bf0-f4aeb382dde7\"},\n                    nil,nil}}}},\n
 {\"user-agent\",\n                 {'User-Agent',\n                     
\"Mozilla\/5.0 (X11; U; Linux i686; en-US; rv: Gecko\/2008071816 
Ubuntu\/8.10 (intrepid) Firefox\/3.0.1\"},\n                
 {\"keep-alive\",{'Keep-Alive',\"300\"},nil,nil},\n                 nil}}}},\n          
'GET',\n          {\"cs-cache\",<0.230.0>,[\"_view\",\"_design\",\"forms\",\"all\"]}]},\n
{couch_httpd,handle_request,2},\n     {mochiweb_http,headers,4},\n     {proc_lib,init_p,5}]}"}

Can anyone point out my error? Most google examples I see are doing _temp_view stuff.


View raw message