Articles, Blog

Firebase Database Querying 101 – The Firebase Database For SQL Developers #3

January 24, 2020


You Might Also Like

52 Comments

  • Reply IsuruKusumal November 18, 2016 at 10:41 pm

    how can i query using two goddamn constraints?

  • Reply Mykola Diachok November 19, 2016 at 4:58 am

    Thanks!!!

  • Reply Odair Seixas November 20, 2016 at 1:34 pm

    there is one way to do something like "name like 'John%'" ?

  • Reply Rey Guerrero November 21, 2016 at 2:19 pm

    Is there a function for contains? like in sql it would be: select * from events where eventname like '%MEET%'

  • Reply Mikko Tan November 22, 2016 at 9:00 am

    #AskFirebase Same question, how to query using two constraints.

  • Reply Cristian G December 2, 2016 at 11:48 pm

    Last screen with the screwing machine such a fail xD. Good video though! Firebase is awesome!

  • Reply 0xDED53C December 3, 2016 at 4:23 am

    I wish to have watched this video last week. Really good explanation.

  • Reply Marcus Paulo December 3, 2016 at 4:27 pm

    Perfect, congratulations.

  • Reply Robert Soriano December 3, 2016 at 5:24 pm

    Hi! How can I order the result with timestamp?

  • Reply טרנדי - הערוץ הרשמי December 3, 2016 at 7:23 pm

    All of you who are planning on starting your projects with firebase, should know that you can not use a query like you would in SQL:
    select .. where d=1 AND d=2
    you can only use equal_to once and do the other filtering within the client code.

  • Reply Andrea Bioli December 5, 2016 at 7:57 pm

    David, I'm studying Firebase right now, and I think I still miss the big picture.
    It looks like Firebase is very easy to use, flexible, and whatever, but the advantage of NOT having and intermediate server layer makes the whole thing fall short when we want to realize a really secure and protected application.
    For example, what if I would like to prevent users from inserting data on Sundays, or if I have to issue an external web api request to see if the user is allowed to edit data…
    It looks like there is some javascript interpreter, to execute the rules in Firebase, but (please correct me!) I don't think this is done to let developers write really complex scenarios, it would really be overkill.
    Please, can you help me in understanding better?
    Thanks

  • Reply Kunal Agarwal December 8, 2016 at 4:39 pm

    No.
    These queries are just not responding to my requests! I've tried rectifying every possible error!
    Still i ain't able to get desired result, and retrieve correct data.
    Please help if possible. 🙂

  • Reply Or Ouziel December 18, 2016 at 2:26 pm

    which app is used to edit the video clips like that?

  • Reply Astitv Shandilya January 4, 2017 at 6:50 am

    how can I query for a specific node in my realtime database that has been created using push() method using one of the values stored within that node(e.g. city = new york),
    Will the following query work:
    mRef.child("restaurants").orderByChild("city").equalTo("New York");

  • Reply calr91 91 January 16, 2017 at 9:31 pm

    How i can use "DISTINCT" in firebase? like: SELECT DISTINCT City FROM Customers

  • Reply Richard Sprince February 8, 2017 at 11:15 pm

    When I add ".orderByChild('myproperty')" to my query, I get an error" Using an unspecified index. Consider adding ".indexOn": "myproperty"? Can't I use this without messing with rules? Not ready for that just yet…

  • Reply vjkrshn ro2 February 16, 2017 at 7:55 pm

    How to query for a key at different copies without events

  • Reply Satyajeet Azad May 25, 2017 at 4:35 pm

    how to display recently added data to database on top once you call from database? I mean recently added data first in the list view.

  • Reply John Kallie June 3, 2017 at 7:57 pm

    This is no way to do a descending order query like  "Newest dates first" ???

  • Reply randomtutorial June 11, 2017 at 4:17 pm

    Am i the only one to spot the SQL queries use "==" which is incorrect. ?
    SQL syntax is just a single "="

  • Reply Arseniy Kucherenko June 26, 2017 at 6:15 am

    How about OR & AND queries in Firebase with multiple fields?

  • Reply David C July 19, 2017 at 11:20 am

    Nicely presented but VERY disappointing. The last query was a joke. Where are the LIKE statements? Firebase team, PLEASE sort this out. What you're offering here just isn't up to the job.

  • Reply hening pda July 30, 2017 at 5:58 pm

    Hey dude . Would you mind to make tutorial about How to Filter Firebase Query RecyclerView with SearchView ?

  • Reply frank lubega August 14, 2017 at 1:07 pm

    Firebase looks cool, but am finding a big problem implementing %like% for searching as it is easily done in sql. can some one help me please

  • Reply frank lubega August 14, 2017 at 1:09 pm

    Hey David East, please help out on this below

  • Reply artnos August 31, 2017 at 9:50 pm

    great content do you guys work for google to teach?

  • Reply Moses Kenap September 21, 2017 at 5:57 am

    Hello sir, thank you for your explanation, really help me as junior programmer. Can you explain me how to convert query like this one:

    SELECT * FROM Event WHERE name="a" AND job="b"

    into query format in firebase?
    Thank you…

  • Reply Chris Wilson October 17, 2017 at 5:52 am

    So for more advanced filtering we need to send all the objects in the child to the client and have their copy of the code do the work? If that is the case wouldn't there be security issues? Like if I have an array of sensitive documents assigned to different people but also could be assigned to more than one person I would have to send a list of all the documents and then trust that the client code sorts out only the ones they are allowed to view. Would it not be better for the data server to only send what is necessary? I'll keep watching and maybe the answer will show up.

  • Reply Sathish K November 2, 2017 at 3:54 pm

    how can i use orderByKey and orderByChild in the same query?
    For example : i need to get next question of specific category (1). but i know current question id value (10).
    “`firebase.database().ref('/questions').orderByKey()
    .startAt("10")
    .orderByChild('category_id')
    .startAt("1")
    .limitToFirst(1).once('value').then(function(snapshot)“`

  • Reply nzackoya November 17, 2017 at 4:51 pm

    when the damn hipsters gather in one place they create something like Firebase. I can't even imagine how it got popular. I'm praying each day so there could be someone who can create something like Parse. When comparing Parse vs Backendless vs Firebase it is same if you compare JS Bach vs Sinatra vs my neighbour that sometimes sing in his bath. Horrible logic, 0 guides.

  • Reply Abhishek Jha November 30, 2017 at 12:48 pm

    Can you tell me How to filter data to show it in search view of android

  • Reply Ali Öztürk December 12, 2017 at 11:22 pm

    I try to sort a list alphabetically (asc) for Turkish app, but letters like ö,ç,ş,I,ğ,ü goes to end of the list. How can I fix it? Thank you

  • Reply Fun Media January 9, 2018 at 10:42 am

    how can i use SQL IN clause in Firebase . e.g. select name from users where id in (1,2,3)

  • Reply Terry January 10, 2018 at 2:00 pm

    i love you man

  • Reply The Lost Creatives February 17, 2018 at 8:50 am

    Its not working for meeeeeeeeee HEELLPPP

  • Reply Juanjo López March 23, 2018 at 7:09 pm

    How can I do the part "render data to HTML"? If I do a console.log(snap.val()) it returns [object Object]

  • Reply Patricio Vargas May 17, 2018 at 2:13 am

    This video is missing follow up with the people asking questions here

  • Reply Atahhh Records September 26, 2018 at 6:56 pm

    how can i query data by the data text i made a video because its kinda hard for me to explain https://www.youtube.com/watch?v=BW7jWxNfeE0&t=61s

  • Reply FrenZie October 13, 2018 at 1:16 pm

    It would be good if they could use the find() method as seen in MongoDB, but for some reason, even though Firebase is essentially a fork of MongoDB, it doesn't contain any such method.

  • Reply Wesley Alves October 29, 2018 at 1:19 am

    This is an excellent tutorial but the firebase documentation is somewhat confusing

  • Reply Fadly Lado November 27, 2018 at 4:21 am

    how to order desc??

  • Reply Геннадий Лобов November 27, 2018 at 9:41 pm

    why its not working in realtime in searchview? Query text = productreff.orderBy("Name").whereEqualTo("Name", searchView.getQuery()); after this step, my app has crashed

  • Reply Renaud Tarnec November 29, 2018 at 4:57 pm

    Hello, it seems there is an error in the code shown at 4m19s. It should be const events = db.ref().child('events'); instead of const events = db.child('events'); (or const events = db.ref('events');)

  • Reply Brijesh Kumar December 5, 2018 at 10:41 am

    how to get column name firebase select query in javascript

  • Reply Raj Remo February 21, 2019 at 11:17 am

    hi dude how to order by desc in firebase

  • Reply Watermelon Man April 22, 2019 at 12:46 am

    So let's say I have a books database and I want to search a substring in the books titles. Not clear if it's even possible !

  • Reply Sreerag Sp May 28, 2019 at 12:42 pm

    awesome..

  • Reply Benjamín Fernández Carrasco June 10, 2019 at 8:27 pm

    It's a evil query sintax I cannot found a simple query like this : select * from events where eventname like '%MEET%' and de case sensitive is a other evil Heeeellllpppppp

  • Reply chinna 98 August 24, 2019 at 8:47 am

    https://stackoverflow.com/questions/57624782/how-to-retrieve-multiple-data-using-specific-field-in-firebase-database

  • Reply Tehseen Ullah November 7, 2019 at 5:09 am

    is there any tutorials on cloud firestore.

  • Reply Learning Point December 10, 2019 at 5:15 pm

    you saved 2 days thank you

  • Reply Juyoung Lee December 25, 2019 at 1:48 am

    only node.js works but not python???

  • Leave a Reply