2017-10-09 70 views
0

此命令PouchDB回404,即使這個文件存在

this._db.query(`classRoom_ZSFtmZiBu/robots`, { 
    classRoomCode: this.classRoomCode, 
}).then(res => res.rows.map(it => it.key)); 

擲404錯誤...

enter image description here

即使設計文檔的數據庫中。 。

enter image description here

"_id": "_design/classRoom_ZSFtmZiBu", 
    "_rev": "1-667891751ba8a733dc1976172de9b513", 
    "views": { 
    "robots": { 
     "map": "function (doc) {\n    if (doc.type === \"robot\") {\n     emit(doc);\n    }\n    }" 
    } 
    }, 
    "filters": { 
    "robotsOnThisClassRoomOnly": "function (doc, req) {\n    return doc.type === \"robot\" && doc.classRoom === req.query.classRoomCode;\n   }" 
    } 

回答

0

我沒有重現您的問題。我使用CouchDB 2.1

以下是我的截圖。

enter image description here

我有兩個文件,其中一個是設計文檔和你一樣。

enter image description here

enter image description here

現在我查詢在瀏覽器中使用CouchDB的。 enter image description here

這是開發控制檯上的查詢結果。

enter image description here

+0

我會嘗試..我1.6.1 – ridermansb

+0

是否使用MAC使用在Apache CouchDB的Fauxton更改版本?你在本地或IP /域上測試過嗎? 在我的機器...只有當我使用IP地址時發生此錯誤 – ridermansb

+0

Bdw ..此錯誤甚至發生在2.1版本 – ridermansb

相關問題