Google Firestore: Query on substring of a property value (text search)

前端 未结 16 1339
抹茶落季
抹茶落季 2020-11-22 12:08

I am looking to add a simple search field, would like to use something like

collectionRef.where(\'name\', \'contains\', \'searchTerm\')

I tried

16条回答
  •  清酒与你
    2020-11-22 12:51

    If you don't want to use a third-party service like Algolia, Firebase Cloud Functions are a great alternative. You can create a function that can receive an input parameter, process through the records server-side and then return the ones that match your criteria.

提交回复
热议问题