小程序
小游戏
企业微信
微信支付
扫描小程序码分享
代码如上,是不是then里面不能再继续查询了?
1 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
你这写法也是牛逼 参考我这里的
const res1=await db.collection('todos').where({progress: _.gte(50)}).get();
if(res1.data.length==0){
const res2=await db.collection('todos').add({data:{progress: _.gte(50)}});
const res2=await db.collection('todos').
}
else{
const res3=await db.collection('todos').doc('xxxxxid').update({data{code:"heheh"}});
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
最后的执行是写Promise.all([res1,res2,res3])吗?
不用
length未定义
自己看看 res1的日志吧
忘记加await了,已经搞定了,谢谢你。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
你这写法也是牛逼 参考我这里的
const res1=await db.collection('todos').where({progress: _.gte(50)}).get();
if(res1.data.length==0){
const res2=await db.collection('todos').
add({data:{progress: _.gte(50)}});}
else{
const res3=await db.collection('todos').doc('xxxxxid').update({data{code:"heheh"}});
}
最后的执行是写Promise.all([res1,res2,res3])吗?
不用
length未定义
自己看看 res1的日志吧
忘记加await了,已经搞定了,谢谢你。