在云函数中操作数据库时, 使用_.gt为何会报错?
function resetLottery(){ console.log("resetLottery start") //清空ticket表 cloud.database().collection('ticket') .where({ time: _.gt(10) }) .get() .then(res=>{ console.log("resetLottery",res) }) .catch(err=>{ console.log("resetLottery", err) })} |
代码是这样的,一样的_.gt在云开发数控制的可以正常使用,但在云函数调用时出现了如下报错
getConfig fail ReferenceError: _ is not defined
是我哪里写得不对吗?求解答
