我正在尝试在 couchdb 中使用视图和列表功能组合来返回多个结果,如下所示
{
"_id": "_design/noid",
"_rev": "5-01bdadc2264f0d20fa2875beb9c264c3",
"language": "javascript",
"views": {
"noid": {
"map": "function (doc) {\n emit(doc.id,...}"
}
},
"lists": {
"onefield": "function(head, req) {\n delete doc._id;\n delete doc._rev;\n provides('json', function() {\n return {'json': doc};\n });\n}"
}
}
当我运行时:
http://localhost:5984/dongdocument/_design/noid/_list/onefield/noid?key="12345"
我总是遇到以下 500 内部服务器错误,不知道我哪里错了?谢谢
{"错误":" render_error","原因":"函数引发错误:( new ReferenceError(\" doc未定义\",\" lists.onefield \",2)) \ nstacktrace:([object Object],[object 对象])@ lists.onefield:2 \ nrunList(function(head,req){delete doc._id; delete doc._rev;提供(\" json \",function(){return {json: doc};});},[object Object],[object 数组])@ .. / share / couchdb / server / main.js:989 \ n(函数(head,req) {delete doc._id; delete doc._rev;提供(\" json \",function(){return {json:doc};});},[object Object],[object 数组])@ .. /共享/ CouchDB的/服务器/ main.js:1036 \ N(\" _design / NOID \" [对象 阵列],[对象 数组])@ .. /共享/ CouchDB的/服务器/ main.js:1517 \ N()@ .. /共享/ CouchDB的/服务器/ main.js:1562 \ n @ .. /共享/ CouchDB的/服务器/主的.js:1573 \ n"}