云數據庫中怎么調用邏輯函數(“or”)
我想查詢 姓名和電話中有skey的集合,你看代碼對嗎
var skey = this.data.skey;
db.collection("rest").where({
name: {
$regex: '.*' + skey,
$options: 'i'
}
or
tell: {
$regex: '.*' + skey,
$options: 'i'
}
}).get({
success: res => {
console.log(res.data)
this.setData({
list: res.data
})
}
2019-07-30
or那里用的不太對,請看下面這個截圖,改成你自己的需求就可以了: