微信查询,微信小程序云开发模糊查询
解释:db.RegExp从基础库2.3.2开始(wx-server-sdk从0.0.23开始),数据库支持正则表达式查询,开发者可以在查询语句中使用JavaScript原生正则对象或使用db.RegExp方法来构造正则对象然后进行字符串匹配。在查询条件中对一个字段进行正则匹配即要求该字段的值可以被给定的正则表达式匹配事例:search(e,val){const_this=thisthis.screenName=econstdb=wx.cloud.database({env:'环境ID'})const_=db.commanddb.collection('person').where(_.or([{name:db.RegExp({regexp:e,option:'i'})},{person:db.RegExp({regexp:e,option:'i'})},{location:db.RegExp({regexp:e,option:'i'})}]).and([{del:0}])).get({success:function(res){_this.list=res.data}})},上面.or中条件为或,.and条件中并列满足。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

