微信小程序 对云数据库的模糊查询
db.collection("post").where({ //collectionName 表示欲模糊查询数据所在collection的名
title: db.RegExp({
regexp: title1,
options: 's'
})
}).get({
success: res=>{
console.log(res.data)
this.setData({
post: res.data
})
}
post 是集合的名字
title 是post中字段的名字
title1 是你要查询的值
虽然简单,基本够用