2017-06-24 83 views
-1

我想在我的沙發數據庫中創建一個新的設計文檔。Couchdb附件名稱'_design/modify'以禁止字符'_'開頭

當我嘗試PUTUpdate Handler

http://myCouchDbServer/myDatabaseName/db/_design/modify 

與以下機構:

{ 
    "_id": "_design/modify", 
    "updates": { 
     "modifyinplace": "function (doc, req) { var fields = JSON.parse(req.body); for (var i in fields) { doc[i] = fields[i] } var resp = eval(uneval(doc)); delete resp._revisions; return [doc, toJSON(resp)]; }" 
    } 
} 

它返回的響應:400 Bad Request

{ 
    "error": "bad_request", 
    "reason": "Attachment name '_design/modify' starts with prohibited character '_'" 
} 

我是在正確的路?

回答

0

URL中刪除/db。您已將數據庫名稱包含在URL中。