这个命令......
this._db.query(`classRoom_ZSFtmZiBu/robots`, {
classRoomCode: this.classRoomCode,
}).then(res => res.rows.map(it => it.key));
投掷404错误......
即使设计文档存在于数据库中..
"_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 }"
}