Common SQL Queries converted for the Firebase Database - The Firebase Database For SQL Developers #4

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии •

  • @saadazzz
    @saadazzz 8 лет назад +302

    I was hoping he'd just say "JUST KIDDING" after doing #8. Holy Hack!!!

    • @damejelyas
      @damejelyas 7 лет назад +14

      saadazzz that was saad azzz cloudy day in berlin

    • @pamelasillah7257
      @pamelasillah7257 7 лет назад +1

      LMAO!

    • @PeterBennettUK
      @PeterBennettUK 6 лет назад +2

      Do explain? Wow #8 jeeese, and it is != && in the WHERE clause it is "AND" :P

    • @AbdulSamad-ct9io
      @AbdulSamad-ct9io 4 года назад +14

      was thinking to use firebase but query 8 left an impression "WTF" what was that

    • @JonathanIsmaila
      @JonathanIsmaila 4 года назад

      @@ToddKerpelmanCorp please can you give us a link? Or can you drop the query syntax here?
      Please help out.

  • @yasminshaikh7432
    @yasminshaikh7432 7 лет назад +102

    Packing up. Going back to SQL

  • @Mikos890101
    @Mikos890101 7 лет назад +57

    8. Query - End of my short journey with firebase

  • @aamederen
    @aamederen 8 лет назад +73

    With Firebase(NoSQL) you don't need to know your schema beforehand; BUT you need to know your queries, which is way more difficult. Bye bye easy and real-time analytics. Let's admit it people, SQL was good and it worked well so far.

    • @davidhsv2
      @davidhsv2 8 лет назад +26

      It's feels like we are going 20 years back... Like old pre-database on text files again... But this time with websocket for real time :P

    • @chriswilson8584
      @chriswilson8584 7 лет назад +8

      With SQL, proper planning of your app and schema gives amazing results. I understand that SELECT using multiple joins can get complicated and may incur a slow response time but you also ensure that your data is consistent and some front end developer doesn't load your DB with garbage.

  • @Ilyesbensalem91
    @Ilyesbensalem91 8 лет назад +250

    oooh man number 8 looks awful

    • @gmaiI.com.
      @gmaiI.com. 8 лет назад +15

      that's what I thought!

    • @berzingen
      @berzingen 8 лет назад +22

      It was dissapointing :)

    • @jayanthmanklu8642
      @jayanthmanklu8642 7 лет назад +15

      shouldn't their DB be bothering about indexes rather than us adding "indexes" as data? I have not seen any sane developer doing this to his own DB!

    • @Mobik_
      @Mobik_ 7 лет назад +17

      He shouldn't even show the last one... now I'm mad.

    •  7 лет назад +37

      After the number 8 I feel dirty, I need to get a shower, AWFUL!

  • @trendyil
    @trendyil 8 лет назад +191

    8. ruined it
    not going to use it until there's a way to check multiple equal values.

    • @wacalu
      @wacalu 7 лет назад +26

      Yeah, how would you have to query everybody that is older than 28 and living in Berlin? That must be a pain to figure out.

    • @pamelasillah7257
      @pamelasillah7257 7 лет назад +3

      it is trust me. im having a very hard time

    • @dcsMagazine
      @dcsMagazine 5 лет назад +3

      Everything is difficult if you are not familiar with it. This helped me with multiple where :
      www.firebase.com/docs/web/guide/retrieving-data.html

    • @JonathanIsmaila
      @JonathanIsmaila 4 года назад +1

      @@dcsMagazine link not found

    • @JamesAutoDude
      @JamesAutoDude 3 года назад

      Still to this day it would kill me. You have to type more too 😬

  • @muratyasar
    @muratyasar 8 лет назад +101

    Come on David, #8 is a pure hack! As far as I experienced, queries are the worst part of the Firebase.. I wish you guys could improve that soon.

    • @Mobik_
      @Mobik_ 7 лет назад +24

      Not only that... for doing something like #8 you need to think in advance all your possible queries, if not, you'll need to make a cron task to update all the data, duplicate that way and then make the query, it's a stupid idea.

    • @スヘア
      @スヘア 3 года назад +9

      It's the end of 2020 and there is no fix for that. Goodbye firebase

    • @vinchbat
      @vinchbat Год назад

      @@スヘア Solved in Firestore

  • @rafaelbrugnollo
    @rafaelbrugnollo 8 лет назад +99

    Query #4: What if I need something like "SELECT * FROM Users WHERE Name LIKE '%ab%'?
    Query #8 is REALLY scary, what if I need Users with age > 20 and location = 'Berlin'? What about a screen where the user can have a unlimited number of filtering the results? should I duplicate all the possibilities and transform the DB in a monster?

    •  8 лет назад +1

      In some video they said That duplicates in Firebase are not bad. Same as in other NoSQL. But it's harder to manage later.

    • @erickcardenas9637
      @erickcardenas9637 7 лет назад

      Lograste hacer la Query #4 con firebase?

    • @davidconnelly1793
      @davidconnelly1793 7 лет назад

      I was about to ask the same thing. Did you ever find an answer?

    • @keroberos2781
      @keroberos2781 7 лет назад +5

      Believe it or not, some people don't speak English. Weird! Right?

    • @gustavoolenka123
      @gustavoolenka123 7 лет назад

      also trying to figure query #4

  • @StoianAtanasov
    @StoianAtanasov 8 лет назад +31

    The indexing trick at the end of the video seems to be general enough to be part of the database functionality. These DIY things are what scare me as a Firebase noob.

  • @fgbarone
    @fgbarone 7 лет назад +33

    Indeed #8 cannot be called a "fix"! its a freaking patch poorly done.... WHAT IF i need to check 3 or more conditions? Do i have to create triplet "indexes"? WHAT IF i have a db with 1 billion entries? Do i have to "index" all entries for all possible combinations of queries?
    This looks absurd #askfirebase

  • @dimitrioschatzidimitriou7546
    @dimitrioschatzidimitriou7546 7 лет назад +12

    Does 8 just mean that I have to go through ALL of my 3 million users every day, calculate their age and update the age_location index?

  • @stvltn
    @stvltn 8 лет назад +22

    Hmm working with the Firebase Database seems to be a lot harder compared to the other one...

  • @Mr.charles.s
    @Mr.charles.s 8 лет назад +32

    #8 impossible to deal with, seems still pretty in beta stage to do such kind of hack...Hope they could make it neat soon

  • @parisqs
    @parisqs 8 лет назад +17

    Hi David, I have 2 further questions regarding your last query: a) Don't u think your index is kinda redundant? If Alice moved from Berlin, Is there a way we can set a rule to automatically update our indexes without altering existing insertions? b) Let's say we have 1M recoreds, how can we add 1M indexes fast? #Askfirebase

  • @k.a.9415
    @k.a.9415 7 лет назад +2

    #8 You may not sort ages in any order, if you specify a location ( users who are 20 - 40 yr's old, and are living in Madagascar) Marvellous work

  • @ValAllenSamonte
    @ValAllenSamonte 8 лет назад +45

    no. 8 looks hackish. hopefully soon we don't have to create things like age_location else the database will grow like hell. just imagine i have to deal with this on every item without assistance. prone to errors.

    • @ValAllenSamonte
      @ValAllenSamonte 8 лет назад +2

      eg. i have to update age, with this structure i also need to retrieve location just so i can update age_location. what if one of the developers forgot to update age_location?
      i understand that we can simply abstract this using third party js libraries, but that's another story.

    • @ValAllenSamonte
      @ValAllenSamonte 8 лет назад +7

      that's a good approach, however it is applicable only if we're dealing with small data. as far as i know the advantage of putting age_location is the ability to set it as index so firebase can query it faster.
      but yeah it seems if we have more than 2 WHERE conditions, i think it is better to query the first condition and the rest of the filters on the client side.

    • @intuneknight9681
      @intuneknight9681 8 лет назад +1

      I agree, number eight needs a work around, what's happen if you have a more than two select and the user start combining values ???

    • @akshaykulkarni7249
      @akshaykulkarni7249 8 лет назад +2

      I guess #8 leaves us with many client side things to be handled if the query gets really big. ☠

    • @jonnyclueless
      @jonnyclueless 7 лет назад +7

      So instead of having to be so constricted by an SQL schema, all you have to do in Firebase is have elements for every possible combination of elements in your database! So much easier!

  • @knexpert1700
    @knexpert1700 8 лет назад +17

    They need to add the ability to query by multiple filters, like: ?age=24&name="sally"&location="Boston"

    • @Mobik_
      @Mobik_ 7 лет назад +6

      age_name_location according to this young man... that's a dumb move from Google.

    • @mequeresapp
      @mequeresapp 7 лет назад

      Tentei fazer isso ai e não deu certo. Não filtra corretamente

  • @Ghaniballx
    @Ghaniballx 7 лет назад +4

    #8 just killed my enthusiasm. I've had the impression Firebase was a limited Data Management system, now it looks like a fancy key-value store.

  • @akshaykulkarni7249
    @akshaykulkarni7249 8 лет назад +12

    I also think #8 is a no go with this scary thing until the right approach. may be you should cover more of those queries come up with something that is practically possible.

  • @vinbhai4u
    @vinbhai4u 8 лет назад +16

    8th answer was a deal breaker :(

  • @bobbycvsixfour5258
    @bobbycvsixfour5258 6 лет назад

    Best of your 8 part series so far.
    customerList: AngularFireList ;
    this.customerList = this.angularFireDatabase.list('customers', ref => ref.limitToFirst(2));

  • @ururunstrive
    @ururunstrive 7 лет назад +2

    Good job on explaining basics queries, it's good to see Firebase team made an effort for explaining how simple queries can be made using Firebase SDK. However, for number 8 (combined queries), I really hope Firebase comes up with something like Parse Compound Query.. My current solution for combining query is to manually parse them on the client side. This is indeed inefficient, but making new attributes just to satisfies combined query is just awful.

  • @RahulSainani
    @RahulSainani 8 лет назад +13

    8 just doesn't seem right. Is there no other way to query when there are conditions on 2 different children?

    • @srjons
      @srjons 8 лет назад +3

      I too have the same question.

    • @raphaeldynk
      @raphaeldynk 8 лет назад +2

      It has to have another way, I can't believe on it

    • @lifermayi2556
      @lifermayi2556 5 лет назад

      did you solve it?

  • @nthonymiller
    @nthonymiller 8 лет назад +5

    Sql queries do not use && syntax for AND. they use the full word.
    Select * from Users where age = 28 and location = "Berlin"

    • @dcsMagazine
      @dcsMagazine 5 лет назад +2

      Are you new to SQL?
      Of course you can use && instead of AND
      You can also use || instead or OR
      You can also negate values with ! instead of NOT

  • @ossf4670
    @ossf4670 8 лет назад +9

    It was all looking great util 8. That was painful

  • @StephenRoseDuo
    @StephenRoseDuo 7 лет назад +3

    Something tells me developers are going to have a feature request that translates SQL to firebase commands

  • @g3luka
    @g3luka 8 лет назад +8

    You could put a cause with OR:
    SELECT * FROM Users WHERE Location = "Berlin" OR Age = 28;

    • @Mobik_
      @Mobik_ 7 лет назад +3

      I think you'll have to do that manually downloading the whole data...

  • @mikkotan534
    @mikkotan534 8 лет назад +5

    What if the query question goes like this:
    Get all users who are above 18 and live in Berlin.

  • @ystar13
    @ystar13 4 года назад

    Going to read the docs more thoroughly, but I came here for the comments regarding #8!

  • @diegobph
    @diegobph 8 лет назад +14

    what if i wanted to find people who are between 20 and 50 who live in berlin

    • @mars3142
      @mars3142 8 лет назад +2

      Maybe: .orderByChild("age_location").startAt("20_Berlin").endAt("50_Berlin")

    • @diegobph
      @diegobph 8 лет назад +6

      Peter Siegmund how about people between 20 and 50 who live in berlin or sf :)

    • @mars3142
      @mars3142 8 лет назад +5

      Rey Guerrero That would be harder. I don't know. #askfirebase

    • @Muescha
      @Muescha 7 лет назад +4

      @Peter
      that not work like that, because 21_SF is with string ordering between 20_Berlin and 50_Berlin

    • @shinichi9do
      @shinichi9do 5 лет назад

      yeah lol

  • @MDiachok
    @MDiachok 8 лет назад +17

    How to make a select "Where name like '%a%'"?

    • @mindaugasguzas5764
      @mindaugasguzas5764 8 лет назад +4

      Would like to know this too. For a search function to work would be cool to have this functionality

    • @OdairSeixas
      @OdairSeixas 8 лет назад +1

      I think that it is impossible. I see some people using elastic search for this.

    • @MDiachok
      @MDiachok 8 лет назад +2

      I think too... and using foreach

    • @FrankLloydTeh
      @FrankLloydTeh 8 лет назад

      So does this elastic aearch work when offline? Not

    • @DocBobD
      @DocBobD 7 лет назад

      Although I dont think there is a way to do this directly with Firebase yet.. i do know if you use something like angular you can pull all the data and then perform a pipe filter/search before displaying to the user in the view. Typically the JSON is small so the impact on the network is pretty minimal if you do it right

  • @lasysk
    @lasysk 6 лет назад +2

    The last one killed Firebase for me.
    Something as simple as a query with 2 clauses cannot be impossible to do.
    What you did, changing the schema is surreal. What if you have 100 users? what if you have millions?
    You cannot possibly think that preddict the questions when building your data is doable.
    This renders something as common as multi filter in forms impossible.
    I was kinda going for the flexibility of NoSQL but so far your videos only taught me that NoSQL has more complex data structure, more complex and limited code to access it, and the only advantage I see is that changing the schema is easy, but that is not the problem with SQL. Creating a table takes 5min. Populating it another 10min. Why is this such a problem?
    I dont understand NoSQL permise.

  • @chadkrause6574
    @chadkrause6574 7 лет назад +1

    I don't think any professional would use this after looking at #8. SQL is still king after that. Wish it could be better

  • @KrisRogos
    @KrisRogos 6 лет назад +1

    Number #8 is a deal breaker... you say in the first video the advantage of NoSQL is I don't need to care about the schema at the start. But now you say I need to care about every single field permutation I might want in the future? What if 2 years into a lifecycle of an app users start to want to filter by 2 fields, with SQL I just slap a 'Where x and y' query under a button and I'm done, with this I need to somehow go over the entire DB file and create new keys?! Then there is the extra storage overhead on the server and performance degradation by comparing ever larger strings.

  • @hachij_
    @hachij_ 7 лет назад

    i hope this quering is getting improve :) nice work firebase!

  • @mrphilbert1
    @mrphilbert1 8 лет назад +1

    Man that last hack just shows that Firebase is not quite ready for prime time. Love the concept but it needs more functionality (like count and aggregations). Hopefully it will be there soon.

  • @natnaelalemayehu9112
    @natnaelalemayehu9112 5 лет назад +3

    I thought I was dump when i figured out how to do multiple querying like the guy did. Well not anymore

  • @CrazySkillz15
    @CrazySkillz15 5 лет назад

    Thanks so much for this video. I was looking for something just like this. Appreciate it!

  • @emilio131
    @emilio131 7 лет назад +2

    Thinking about how to deal with #8 in a more tidy way (speaking of iOS but it should work with any platform) what if you get the results that match one of the conditions (age 28) and then on the client (iOS, Android, Web) refine that query for instance with an NSPredicate in iOS (looking for the ones that live in Berlin).
    So you get one broad set from the firebase and then on the client you refine that set to your needs. What do you guys think? Drawbacks? #Askfirebase

  • @LookNumber9
    @LookNumber9 7 лет назад

    Come on. 8 was a total cop-out. We'll never know with certainty what queries we may need in the future. There's got to be a better way. Having said all that, thank you for the other parts; they were helpful.

  • @Sam-em1ic
    @Sam-em1ic 8 лет назад +4

    I think I understand limitToFirst and limitToLast, but say I had 1000 results and I wanted to paginate them, how would I limit to 50 at a time (kind of like how gmail does)? Or would I have to pull in the whole set? Cheers

    • @intuneknight9681
      @intuneknight9681 8 лет назад +1

      Is Javascript you have to write one hundred lines of codes to achieve that.

  • @peterlum6203
    @peterlum6203 6 лет назад +1

    #8 is a step back. What if there are multiple AND in the WHERE statement? What if I change the age, then I also have to change the age_location, etc, etc.

  • @HelloWorld1987
    @HelloWorld1987 5 лет назад +1

    #8 is a killer... Is this still the case? Or is there an update.? don't want to read the documention right now...

  • @paganaye
    @paganaye 7 лет назад

    Excellent very useful for the LearnByExample people.

  • @wobsoriano
    @wobsoriano 8 лет назад +5

    Text Editor he is using = Visual Studio Code

    • @mrslake7096
      @mrslake7096 7 лет назад +2

      The best editor javascript i've tried

  • @magnus49
    @magnus49 7 лет назад +1

    It really feels like Firebase and Angular are thought up by IT hipsters without a proper computer science education. I mean, creating a reduntant attribute that will be hard to maintain, just to be able to make a query that involves more than one attribute... so you're telling me THIS is somehow the future, and more convenient than SQL? Give me a break, this is 2017, not 1977. Similarly, Angular transports us 15 years back and introduces spaghetti code 2.0, nice job. I'm starting to lose hope for Google if they don't step up their game and start learning from history.

  • @mrbam8
    @mrbam8 7 лет назад

    This is one of the most helpful tutorials I found yet! Thanks!!

  • @rodrigodifederico
    @rodrigodifederico 8 лет назад +3

    Jeez, repeating data in order to create new indexes, so stupid, in the end your data will be full of trash and confuse to read. Anyway, despite the fact that SQL, in the end, is A LOT easier to read/write/use, it doesn't make sense to "teach" SQL users how to use Firebase, because basically they shouldn't use Firebase. If they do, they will be switching from a working project with SQL to a No-SQL project, and these projects should definitely not be the same, or, you have a big problem with your project scope.

  • @tejasjani2544
    @tejasjani2544 4 года назад +1

    What should I do when I want to get data with more combinations like (age_lacation) query. Every time i go and change my schema😥. #askfirebase

  • @rossiAP
    @rossiAP 6 лет назад +1

    Anyone knows if the number #8 has a better way to work when it's necessary to make query like:
    "Select * from users where Location like 'B%' && age>30" .....
    This way on the video it's terrible! Unfortunately i think the best way is filter on client

    • @adriannunez7088
      @adriannunez7088 5 лет назад

      You could create location_age and do: rootRef.child('users').orderByChild('location_age').startAt('Berlin_31');

  • @lucasdotnet
    @lucasdotnet 6 лет назад

    Keep up the good work

  • @Tolg
    @Tolg 7 лет назад

    Thank you for the video. This was helpful. It would be great if the sample built during the video could be posted. It would make it easier for people who have seen to video to experiment further.

  • @Layer8Master
    @Layer8Master 6 лет назад +1

    There is still no better way to make the number 8? could you answer me please

  • @buncha_jaggovfs
    @buncha_jaggovfs 3 года назад +1

    haha such a funny channel, love this content!!! woohoo

    • @Firebase
      @Firebase  3 года назад

      Thanks so much!!

  • @MikeZaharov
    @MikeZaharov 8 лет назад +12

    And if one minute later we need make request: age 30 and location is Berlin... and then: age 25 and location is London?

    • @pokefan2711
      @pokefan2711 4 года назад

      Well, you can create a dynamic query reference, like const ref = (age, loc) => rootRef.child('users').orderByChild('age_location').equalTo(`${age}_${loc})

  • @ryandury
    @ryandury 7 лет назад +2

    What's the point of having a scalable / large data object when you can't even filter on it. SAD! ;)

  • @Mobik_
    @Mobik_ 7 лет назад +1

    The last query it's almost an insult and shouldn't be here. So, I need to think my data structure for the queries I MAY HAVE in the future???? That's crap! How many times should I need to duplicate data with a crappy structure? And with 3 or more relations? Wow... Parse did one excellent job and Firebase can't even handle it.

  • @stevefreed3646
    @stevefreed3646 7 лет назад +1

    When you get the users back do they return as JSON files? How would I obtain a certain attribute from a user that I get as a result of my query?

  • @khatarnakgamer2738
    @khatarnakgamer2738 5 лет назад

    i have 2 users Customer and Worker
    whenever customer books a worker for work the worker will get option to accept or decline
    and when customer books a work i store in firebase as "key"="bookingtimedateprogress" and its "value"="28-08-2019 01:30 AM Accepted/Declined"
    here i need to fetch data that startAt(time) and contains="Accepted"
    query1 = FirebaseDatabase.getInstance().getReference().child("App Data").child("Booking").child(userID).orderByChild("bookingtimedateprogress").startAt(currenttime)..... ???
    How can i user contains even with startAt

  • @TonyKrger
    @TonyKrger 8 лет назад

    Great video! Would be even better if this video was referenced in firebase documentation.

  • @umbertohe5723
    @umbertohe5723 5 лет назад +1

    How can i do a sql with a rage of dates
    Like between 12/12/2012 and 12/12/2013

  • @paragkadam2169
    @paragkadam2169 7 лет назад +1

    Really man, so we now need to pre-decide what queries we would need before structuring our database. And what if we miss one query and have our json structure already decided, is it really worth to change the json structure to accomodate just one query, that's making the developer's life hell, fix it man.

  • @Noway2000Mr
    @Noway2000Mr 4 года назад

    excellent query firebase course

  • @jamnich1
    @jamnich1 3 года назад

    I know this is an old video, but I don't see the question asked in the comments anywhere.
    Once you have: (#8)
    const eightRef = rootRef.child('users').orderByChild('age').equalTo('28')
    cant you just make a new query on the eightRef you just created to get only people out of it that live in Berlin?
    along the lines of:
    nineRef = eightRef('users').orderByChild('location').equalTo('Berlin')

  • @qalqi
    @qalqi 6 лет назад +1

    8) Alternatively, with Firestore we have usersRef.where("age", "==", "28").where("location", "==", "berlin")

  • @tinachen9428
    @tinachen9428 7 лет назад

    For those of you who got let down by #8, maybe Firestore, a NoSQL cloud database from the same firebase team, will offer some hopes.
    Here is a snapshot of Firestore's querying capability:
    var citiesRef = db.collection("cities");
    citiesRef.where("state", "==", "CA")
    citiesRef.where("state", "==", "CA").where("population", "

  • @alexgoiadev
    @alexgoiadev 6 лет назад

    How can I can do an aggregation (OR) on firebase ? For example Select from Users where name = 'example1' or name='example2'? Thank you.

  • @JonathanIsmaila
    @JonathanIsmaila 4 года назад

    That last query seem won't go well. To use the query, do I have to add the custom age_location entry to every record in the database?
    What if my database has been in use for long and I need to use a new query like that e.g. when there's an update to my app where I need to add a new query view? Do I then need to go and edit every record in the database and add the custom entry field as shown in this video?

  • @sodreigor
    @sodreigor 6 лет назад +1

    Are these queries still up to date as of September 2018???

  • @SameerRazaKhan792
    @SameerRazaKhan792 6 лет назад +1

    Everything was perfect except #8. totally destroyed the flow.. No way I am going to create such strange keys, in this case, please be open, you create one ref and then another ref inside to get specific data.

  • @peterdvukhrechensky3339
    @peterdvukhrechensky3339 4 года назад +2

    Does it get any better about the 8th query in 2020?

    • @pokefan2711
      @pokefan2711 4 года назад

      Nope.

    • @pokefan2711
      @pokefan2711 4 года назад

      If you want to stick with Firebase environment, you should check out the Firestore. But, it isn't designed for fast data updates, for each document. The limit is around 1 change per second, per doc. A doc, is like a node of data. An user data, as example.

  • @peteski22_
    @peteski22_ 7 лет назад +1

    Lord have mercy RE:#8. Something that is expressed clearly and doesn't mean making a mess of your data in SQL, is butchered in Firebase/NoSql. *sigh*.

  • @fadlylado
    @fadlylado 6 лет назад +1

    Hope u can fix poin 8..

  • @HelySaul
    @HelySaul 7 лет назад

    Hello David, i have a question for you. Is there a way to simulate a "WHERE IN" on FRD? Something like "SELECTE * FROM table WHERE value IN ('val1', 'val2', 'val5')"

  • @vugargaragozlu6737
    @vugargaragozlu6737 4 года назад

    totally helpful!

  • @kesneydt2664
    @kesneydt2664 5 лет назад

    Very Helpful video. How to you do a Select with an OR???

  • @pablovasarely
    @pablovasarely 4 года назад

    how could I make a voluntary consultation on firebase? "UPDATE table set field = field + 1 where field2 LIKE '% DATA%"? in case I want to update with +1 all the records that contain DATA at the beginning, middle or end of the field.

  • @davidconnelly1793
    @davidconnelly1793 7 лет назад +1

    If I have understood this video, then Firebase is awful.
    Let's assume I want to do a query equal to:
    "select * from users where name = 'David' order by dateCreated"
    Would I be right in saying that this is IMPOSSIBLE with Firebase (because we are forced to orderBy the thing that we are filtering)? If that's the case then it's really REALLY bad. Can somebody please tell me that I've misunderstood this.

  • @suvankarbose
    @suvankarbose 7 лет назад +3

    How can we get age > 20 and location 'Berlin'

    • @TonyAllen1
      @TonyAllen1 7 лет назад

      maybe orderByChild('location_age').startAt('Berlin_21')

  • @russelmuamba9578
    @russelmuamba9578 3 года назад

    The last case is not handled efficiently on NOSQL, because suppose we have to select based on ten different fields, which will somehow change, it will be hard to create several data combinations for all cases...

  • @hilens2091
    @hilens2091 3 года назад

    Tried to sneak in #8 and hoped we didn't notice ;)

  • @nicbog3043
    @nicbog3043 8 лет назад +2

    How would you a negative queries? Select everyone that is not 'david'?

    • @KentLiau
      @KentLiau 8 лет назад

      filter it at client side, if you are doing paging, and there is not enough result for the page, query another set filter out david, if there is extra for next page, hold it.

  • @brunogustavokilian
    @brunogustavokilian 7 лет назад

    Question about age_location: I understand the need as a realtime NoSql database and scalability to create the combined field. Is there a way to create it from the console in batch for all the registers?

  • @damejelyas
    @damejelyas 7 лет назад +1

    why not just admit that firebase can't handle chained conditions

  • @michelfeinstein
    @michelfeinstein 6 лет назад +1

    What about "less than" for float? Just placing 49.9999 isn't practical

  • @scratchprogrammingtutorial9034
    @scratchprogrammingtutorial9034 7 лет назад

    what's the diff. between orderbyChild vs orderbyvalue. When do we use orderbyValue()

  • @hernandezurbina
    @hernandezurbina 5 лет назад

    writing this on March 2019, is Firebase still doing that horrible thing for query #8?

  • @davidhayes4259
    @davidhayes4259 8 лет назад

    The limit is cool. Is there a start at or start after?

  • @chrismok23
    @chrismok23 8 лет назад

    How to make a select "select count(*) from users where age>30" which return 1000+ records. If I get these objects and count from client side, it may cost a lot of bandwidth. So any solution on this case

  • @soulure
    @soulure 3 года назад

    Dumb question, once I have one of these references, how do I actually see the data?

  • @parrou3
    @parrou3 8 лет назад +4

    how to transform COUNT in sql ?
    SELECT COUNT(USER_ID) from USERS WHERE USER_ID = UID;

    • @davidhayes4259
      @davidhayes4259 8 лет назад +1

      That cannot scale well can it?

    • @davidhayes4259
      @davidhayes4259 8 лет назад +1

      Oh boy, that is sacrificing a lot for how cool firebase is.

    • @Mobik_
      @Mobik_ 7 лет назад

      well, right now they had added "functions" that can work automatically when new data shows up on the firebase database, that can count "server side" (is just a js method inside a nodejs heroku-style server from firebase) into a new variable/string object of your JSON

    • @masrajha
      @masrajha 5 лет назад

      it could process with javascript array, but the answer that query is 1. user only have 1 UID... :-)

  • @GopalKrishanAggarwal1
    @GopalKrishanAggarwal1 7 лет назад

    Firebase needs to do something about number 8 type queries.

  • @politicallynotcorrect2968
    @politicallynotcorrect2968 4 года назад

    Is that really the best practice to get age and location??
    What is i build a dynamic data analysis app?

  • @alexbeloff4618
    @alexbeloff4618 3 года назад

    I had to learn firebase, then I watched tutorial videos... until this #8... And I quit my job!

  • @andresbillini2363
    @andresbillini2363 7 лет назад

    Query #4: What if I need something like "SELECT * FROM Users WHERE Name LIKE '%ab%'?

    • @Noway2000Mr
      @Noway2000Mr 4 года назад

      have you found any solution yet?

  • @edisvelicanin8854
    @edisvelicanin8854 6 лет назад

    this one was really helpfull. thank you very much. is there a video about how to prewent children in the firebase with the same data, for example, i don't want to push to firebase if the email is already in the database,in other words, if there is a user with that email?

  • @poolkrooni
    @poolkrooni 6 лет назад +1

    For everyone worrying about #8: Firebase's new Firestore has composite indexes to solve these.
    Check out from minute 10: ruclips.net/video/Ofux_4c94FI/видео.html

  • @i.o2485
    @i.o2485 7 лет назад

    so what happens when you use firebase to try and retrieve data that doesnt exist? like if you queried for some random email addresss thats not present in the data??

  • @otifelix
    @otifelix 6 лет назад

    super cool

  • @TiagoSamaha
    @TiagoSamaha 7 лет назад

    How can I filter by field and timestamp? E.g.: Last inserted question (timestamp) from the "Company" poll.