I would like to create a search feature for my apps by using firebase real time database, which similar to facebook search.
I did some research and acknowledge that firebase real time is not able to search with "text contain". But i believe there must be some method to achieve it, like combine startAt or endAt.
I need some advise the best practice to do it.
The DB structure will look like:
Restaurant
-->RandomID
---->name: 'Good Restaurant'
---->address:
---->desc:
-->RandomID
---->name: 'Dixon Lee Restaurant'
---->address:
---->desc:
-->RandomID
---->name: 'MCD'
---->address:
---->desc:
Edited I not sure how the startAt and endAt work. Is it supposes to return 3 and above if i use startAt(3)? What if i use startAt with string? Like below problem i ecnounter:
firebase.database().ref('/restaurants').orderByChild('name').startAt('Good').on('value',snap=>{
console.log(snap.val())
})
I am thinking to achieve "text contains" with startAt/endAt, which will find specific value of field that begin/end with a keyword. Not sure is this the usage for startAt/endAt.