微信小程序云开发使用and/or逻辑操作符
发布时间
阅读量:
阅读量
记录 2020-07-28
逻辑操作符and
and 方法 区间范围
在and的实现过程中,依然采用command方法,并调用gt、lt、eq等操作。
实例
x:.and(.gt(0),_.lt(100)) 通过调用command方法中的and功能,在括号内部依次使用gt与lt方法,从而筛选出大于0且小于100的数值
getData(){
db.collection("demolist")
.where({
x:_.and(_.gt(0),_.lt(100))
})
.get()
.then(res=>{
console.log(res);
this.setData({
dataList:res.data
})
})
},
逻辑操作符 or
or的用法
获得44或66
.where({
x:_.or(_.e
全部评论 (0)
还没有任何评论哟~
