我想搜索我的 firebase 数据库,以便用户能够找到他们正在搜索的产品。
目前,我正在将数据属性 this.searchText 与 firebase 中的 product.title 匹配。
return str.filter((product) => {
return product.title.match(textSearch)
})
我对此有疑问:
如果数据库包含 1000 个产品,则过滤站点上的产品没有意义,而是进行有效的查询,例如:
firebase.database.ref('products').containing('leather shoe')
我只是找不到合适的解决方案。