select * from xx where (a = #{id} or b=#{id}) and (aname like #{name} or bname like #{name})
需要吧上面的查询转成云开发
这是我的代码
db.collection('chat_record').where(_.or([
{ userA_id: that.data.userInfo._id },
{ userB_id: that.data.userInfo._id }])
.and([{
//这个and里面要写成userB_nickName like #{name} or userA_nickName like #{name},怎么写
userB_nickName:db.RegExp({
regexp:that.data.cvalue,
option:'i'
})
}])) .skip( pageStart).limit(that.data.cpageSize)
.orderBy('time', 'desc').get( ).then(res => {
})
希望提供思路
_.and([ _.or([ a = id,//自己写 b = id ]), _.or([ name条件1, name条件2 ]) ])