为什么小程序不能读数据库?

小程序 文章 2021-03-10 10:01 677 0 全屏看文

AI助手支持GPT4.0

为什么小程序不能读数据库?Why can't the applet read the database?

为什么小程序不能读数据库?

数据库数据权限为:所有用户可读,仅创建者可读写。 但出错

db.collection("0mmmm").where

password:e.detail.value.pwd

}).get({

success:pdr=>{

console.log("1",pdr)

},

fail:er=>{

console.log("2",er)

}

})

2 Error: errCode: -501000  | errMsg: Environment cannot access from wx-miniapp

    at new g (VM22 WAService.js:2)

    at Function.success (VM22 WAService.js:2)

    at C (VM22 WAService.js:2)

    at Object.success (VM22 WAService.js:2)

    at B (VM22 WAService.js:2)

    at f (VM22 WAService.js:2)

    at VM22 WAService.js:2

    at A.<anonymous> (VM20 asdebug.js:1)

    at C (VM22 WAService.js:2)

    at VM22 WAService.js:2

Database data permissions: all users can read, only the creator can read and write. But it went wrong db.collection ("0mmmm").where password:e.detail.value.pwd }).get({ success:pdr= >{ console.log ("1",pdr) }, fail:er= >{ console.log ("2", er) } }) 2 Error: errCode: -501000 | errMsg: Environment cannot access from wx-miniapp at new g (VM22 WAService.js :2) at Function.success (VM22 WAService.js :2) at C (VM22 WAService.js :2) at Object.success (VM22 WAService.js :2) at B (VM22 WAService.js :2) at f (VM22 WAService.js :2) at VM22 WAService.js :2 at A. (VM20 asdebug.js :1) at C (VM22 WAService.js :2) at VM22 WAService.js :2

回答:

江户川:

env:‘这里写上环境id就行

陈宇明:

云环境问题

触不可及จุ๊บ:

errCode: -501000  | errMsg: Environment cannot access from wx-miniapp

-EOF-

AI助手支持GPT4.0