导入数据源并实现精准搜索功能
1.事先准备好新闻数据,并修改数据权限
2.精准搜索采用where语句
Page({
onLoad(){
wx.cloud.database().collection('news')
.where({
title:'谷爱凌是谁'
}).get()
.then(res=>{
console.log('请求到的数据',res)
})
}
})
3.搜索结果