-1

I have done some research on Firebase database query for Android. But I still could not find the way to do searching for a substring of a string. For example, I want to search for "def" in "abcdefghijkl". How supposed can I get that by using startAt() and endAt() or there is another way to do it?

Thank you.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Ng Yk
  • 83
  • 1
  • 7

1 Answers1

1

You can search for strings using

databaseReference.orderByChild('_searchLastName')
             .startAt(queryText)
             .endAt(queryText+"\uf8ff")
             .once("value")

How to do a simple search in string in Firebase database?

Community
  • 1
  • 1
Martin De Simone
  • 2,108
  • 3
  • 16
  • 30