小程序-云开发,云数据库中有也有数据。在select查询获取记录是报错。并且数据库集合权限也已经设置为:所以用户可读,创建者可读写
代码如下:
news.doc(id).get().then((res)=>{console.log(res)})
news.doc(id).get({
success:res=>{
this.setData({
article:res.data,
isAdd:false
})
wx.hideLoading()
}
})
控制台提示错误信息:WAService.js:1 Uncaught (in promise) Error: errCode: -1 | errMsg: document.get:fail Error: cannot find document with _id 3, please make sure that the document exists and you have the corresponding access permission; at document.get api;
因为调调用没反应 所以加了一行调试信息(第一行) 也是一样的错误
集合权限设置为所有人可读就行了