2017-10-09 33 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

相关问题