我正在按照此处的说明将列表函数添加到我的 CouchDB: http: //guide.couchdb.org/draft/transforming.html
当我访问列表函数对应的 url 时,我得到消息:
{"error":"not_found","reason":"missing_named_view"}
这是我构造的列表函数对应的url:
edtalmadge.iriscouch.com/burritohunter/_design/export/_list/bar/locations
这是文档中给出的网址:
/db/_design/foo/_list/list-name/view-name
我究竟做错了什么?
这是我到目前为止所做的:
将视图文档添加到蒲团:
{"_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 }); } }" } }}
将列表文件添加到蒲团:
{"_id": "_design/export", "_rev": "2-99c7be486f53d56926a8dc890e182d01", "lists": { "bar": "function(head, req) { var row; while (row = getRow()) { return 'foo' } }", "zoom": "function() { return 'zoom!' }" }}