有没有办法在 couchdb 设计文档中输入注释?
这些查询可能会变得非常神秘,如果能够对它们所做的事情编写一个简短的人类描述,那就太好了。
最佳答案
如果您想在 JS 代码中添加注释,没问题。
function (doc) {
// comments are ok here
if (doc.type === 'user') emit(doc.username);
}
但是,您无法向外部 JSON 添加注释,因为 JSON 不支持注释。
{
"views": {
"by-name": {
// you can't put comments here
"map": "function (doc) { ..."
}
}
}
关于couchdb - 向 couchdb 设计文档添加注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32528072/