// 点击搜索 handleSearch() { let value = '标题' db.collection('goods').where({ title: db.RegExp({ regexp: value, //做为关键字进行匹配 options: 'i', //不区分大小写 }) }).get().then(res=> { console.log("查询结果", res) }).catch(err=> { console.log('查询失败',err); }); },
请教云开发数据库查询字符串中是否包含字符的方法?数据如 { title : '我是标题' }, 查询title包含"标题"这个字符,并返回结果, db.collection.where没有对于字符串"包含"的功能, 有一个数组查询的. 请教怎么实现所述功能?
2021-03-30