let key = "码上到";
const db = wx.cloud.database();
const _ = db.command
db.collection('voices').where(_.or([{
name: db.RegExp({
regexp: '.*' + key +'.*',
options: 'i',
})
},
{
cate: db.RegExp({
regexp: '.*' + key +'.*',
options: 'i',
})
}
])).get({
success: res => {
console.log(res)
},
fail: err => {
console.log(err)
}
})
微信小程序云开发多字段模糊搜索,做笔记自用