1.在云开发中,数据库的读写权限最高是:‘’所有人可读,仅创建者可读写‘’
所以,直接操作数据库更新他人创建的数据库是做不到的。
//xiangqing.js
//每次进入帖子详情页面,帖子阅览数+1
onShow(){
let that=this
wx.cloud.init({
env:"test"
})
const db=wx.cloud.database()
db.collection("ForumPost").doc(that.data._id).update([
data:[
viewerNums:db.command.