示例:
await db.collection('user').where({
openid: openid
}).get().then(res => {
console.log(res)
})
注意:
1、使用异步await;
2、回调使用Promise风格,success, fail, complete则不生效;
示例:
await db.collection('user').where({
openid: openid
}).get().then(res => {
console.log(res)
})
注意:
1、使用异步await;
2、回调使用Promise风格,success, fail, complete则不生效;
本文标题:小程序云函数操作数据库
本文链接:https://www.haomeiwen.com/subject/glbhyctx.html
网友评论