小程序数据库操作会有Promise风格的回调,备注一下回调写法给新人
db.collection('userInfo').where({
_openid: _.eq(openid)
}).count()
.then(res => {
console.log(res.total);
}).catch(res => {
console.log(res);
})
count()请求的结果是Promise风格,要用then->catch接收
小程序数据库操作会有Promise风格的回调,备注一下回调写法给新人
db.collection('userInfo').where({
_openid: _.eq(openid)
}).count()
.then(res => {
console.log(res.total);
}).catch(res => {
console.log(res);
})
count()请求的结果是Promise风格,要用then->catch接收