3
votes

I'm following the instructions here to add a List Function to my CouchDB: http://guide.couchdb.org/draft/transforming.html

When I visit the url corresponding to the list function, I get the message:

{"error":"not_found","reason":"missing_named_view"}

Here is the url corresponding to the list function I've constructed:

edtalmadge.iriscouch.com/burritohunter/_design/export/_list/bar/locations

Here is the url given in the documentation:

/db/_design/foo/_list/list-name/view-name

What am I doing wrong?

Here's what I have done so far:

  1. Added views document to Futon:

     {"_id": "_design/locations",
     "_rev": "16-c0702b81430f6b0d428c7a3e201dfc15",
     "language": "javascript",
     "views": {
         "locations": {
         "map": "function(doc) { if(doc.type == 'location') {emit(null, { 'name': doc.name, 'address': doc.address, 'geolocation': doc.geolocation, 'phone': doc.phone, 'open_24': doc.open_24, 'beer': doc.beer, 'rating': doc.rating, 'type': doc.type }); }  }"
       }
     }}
    
  2. Added lists document to Futon:

    {"_id": "_design/export",
    "_rev": "2-99c7be486f53d56926a8dc890e182d01",
    "lists": {
        "bar": "function(head, req) { var row; while (row = getRow()) { return 'foo' }                  
         }",
         "zoom": "function() { return 'zoom!' }"
     }}
    
1

1 Answers

4
votes

Either add your list function to your locations design document, or modify the URL for accessing your list function to use the fully qualified view name with _list/listName/designDocName/viewName, like:

edtalmadge.iriscouch.com/burritohunter/_design/export/_list/bar/locations/locations

That URL works currently, returning "foo". (If locations/locations looks weird, it's just because your view name is the same as your design doc name.)

If you don't fully qualify the view in the URL by including the design doc, it is assumed that the view belongs to the same design doc that the list function belongs to.