db.collection(goods).orderBy('createTime', 'desc').where(
_.or([{
title: db.RegExp({
regexp: value,
option: 'i'
})
},
{
_id: db.RegExp({
regexp: value,
option: 'i'
})
},
{
id: db.RegExp({
regexp: value,
option: 'i'
})
},
{
firstTitle: db.RegExp({
regexp: value,
option: 'i'
})
},
{
secondTitle: db.RegExp({
regexp: value,
option: 'i'
})
},
{
goodnotes: db.RegExp({
regexp: value,
option: 'i'
})
},
{
[`detailImages.desc`]: db.RegExp({
regexp: value,
option: 'i'
})
}
])
.and([{
isgrounding: true
}])
).skip(index * 20).limit(20).get({
success(res) {
},
fail(err){
console.log('219',err)
}
})
这种形式的查询在开发者工具上没有问题,在手机上报错Error: errCode: -502001 database request fail | errMsg: [FailedOperation.Query] (BadValue) $or/$and/$nor entries need to be full object
1、变量参数写死了试一下。
title: db.RegExp({
regexp: '鸡蛋挂面',
option: 'i'
})
}
]).and([{
isgrounding:true
}])).get()