1

I can check in the firebase if value exist by using this function:

  ref.child("users").orderByChild("id")
  .equalTo("string").once("value",snapshot => {
      if (snapshot.exists()){
         //exist
      }
   })

But my question is, can I do like includes function do? For exemple, I want to check if a part of my string exist on firebase. I would like to check if there is id that includes str for exemple. Is there anyway to do this?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Tiago Castro
  • 421
  • 6
  • 20
  • 1
    Firebase Realtime Database queries can do prefix matches (looking for values that *start with* a certain string), but can't check if a value *contains* a string. See https://stackoverflow.com/questions/28589092/firebase-query-find-item-with-child-that-contains-string and https://stackoverflow.com/questions/22506531/how-to-perform-sql-like-operation-on-firebase – Frank van Puffelen Sep 05 '18 at 18:57
  • Ok thanks, gonna check for other database options – Tiago Castro Sep 05 '18 at 19:12

0 Answers0