小程序云函数操作数据库
2019-10-24 本文已影响0人
忆枫_heartill
示例:
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则不生效;