What's the updated and effient way to query sql like in firebase? I've search in forums and they say I should query all the documents then just do a javascript match function
Asked
Active
Viewed 2,032 times
1
-
Does this answer your question? [Firebase Database in SQL](https://stackoverflow.com/questions/42222347/firebase-database-in-sql) – michaeldel Apr 30 '20 at 03:35
-
See Doug's answer. Additionally, you may get a more specific answer if you can update your question with the query you're trying to do. Include a description of the query, what your Firebase structure looks like and what the desired outcome is. – Jay Apr 30 '20 at 16:17
1 Answers
2
Neither database provided by Firebase (Realtime Database and Firestore) have support for LIKE queries. This is not going to change any time soon, as these types of queries do not scale with the sort of indexes provided by these database.
You can do string prefix queries, which is similar to "WHERE field LIKE foo%", but that's all you get.
For Realtime Database, see:
- Firebase matching substring
- How to perform sql "LIKE" operation on firebase?
- Firebase query - Find item with child that contains string
For Firestore, see:

Doug Stevenson
- 297,357
- 32
- 422
- 441