读取数据库JS如下:
const _this = this
const db = wx.cloud.database()
const _ = db.command
that.setData({
star_date:{dt1:_.gte(that.data.star_date1)},
end_date:{dt1:_.lte(that.data.end_date1)}
})
const table1go = db.collection('Resume')
table1go
.where(_.or([
{f1:db.RegExp({regexp:this.data.search_data,option:'i'})},
{f2:db.RegExp({regexp:this.data.search_data,option:'i'})},
])
.and([{f18:"使用登记"}])
.and([{f16:"核定"}])
.and({f4:db.RegExp({regexp:this.data.search_data1,option:'i'})})
.and([this.data.star_date])
.and([this.data.end_date])
)
.count()
.then((res) => {
console.log(res.total)
this.setData({
max_page:parseInt((res.total-1)/20)*20
})
})
.catch((err)=>{
console.log(err)
})
苹果13pro IOS15.3.1 读取数据库打印错误日志如下图:
errCode: -502001 database request fail | errMsg: [FailedOperation.Query] (BadValue) $or/$and/$nor entries need to be full objects
调试器能成功打印出数据,如下图:
安卓手机和低版本的苹果能查询到数据!! 请求解答,谢谢。
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
把注释部分改为下部分就可以了,这样的话,我小程序所有js部分都需要更改后重新提交审核,工作量很大,我想知道有别的办法吗?