云函数报 "errorCode":1 错误

发布于 7 年前作者 fujie7039 次浏览最后编辑 7 年前来自 ask

代码如上,是不是then里面不能再继续查询了?

1 回复
jie00
jie001 楼5 年前

你这写法也是牛逼 参考我这里的

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"}});

}