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

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

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

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

    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.

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

      this might be actually helpful not sure if you wanted to implement the same thing
      stackoverflow.com/questions/42118908/query-with-multiple-where-clauses-in-firebase

  • @randomtutorial5462
    @randomtutorial5462 7 лет назад +38

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

    • @luiaslan
      @luiaslan 5 лет назад +4

      It depends on the DB type. Some of then uses double equals.

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

    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.

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

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

  • @chandreshmendapara1094
    @chandreshmendapara1094 4 года назад +3

    Sir,
    My query is like this...
    Select * from table where name="John doe" and country="USA";
    So here how can I orderbychild (name & country) and country.

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

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

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

    excellent firebase query course

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

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

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

      Rey Guerrero I don't think so. Like in regular SQL, to do things right you need to explicitely index data you wanna search in a dedicated platform, a search engine like ElasticSearch.
      Or... If you dont have petabytes to search, just use Firebase and perform filtering operations yourself in javascript. This second solution has the great advantage to be 100% client so it works offline.

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

      @@DenisTRUFFAUT this sucks. Such a basic thing !

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

    this tutorial is just amazing thanks a lot

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

      Glad you liked it!

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

    I like the way it was compared to the sql relational database way

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

    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');)

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

    Hi! How can I order the result with timestamp?

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

    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

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

    How to you achieve the same query results in java or kotlin?

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

    why does orderByChild return the wrong ordered data for me

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

    Is this tutorial for Firestone or RealTime Database or both

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

    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");

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

    you saved 2 days thank you

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

    how can i query using two goddamn constraints?

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

      IsuruKusumal Firebase is a NoSQL storage engine. Means a key-value store. Only simple querying operations allowed. You have to design the database to create as much indexes (key-value) as needed and maintain them yourself. Brain revolution, isn't it ? After decades of SQL it can take few months to fully understand the concepts.

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

      Denis TRUFFAUT wouldn't it create so much redundant data? and I know that multi-path updates are a thing, but that would still create so many paths to be updated, slowing down the entire database

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

      Depends on your usage.
      In SQL you have centralized data so write/update operations are easier. But when you want to read, you need to join accross multiple tables and your application can slow down dramatically.
      NoSQL have indeed redundant data so managing write/updates (consistency) is your responsibility but as you don't need to join (your data has been prepared/computed in the write/update operation) reads are significantly faster.
      Oh and don't worry about speed or storage capacity, Firebase Realtime database is built upon Google infrastructure.

    • @Weaver_Games
      @Weaver_Games 8 лет назад +10

      I'm personally finding the NoSQL world to be very limiting so far.

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

      I'm personally finding the NoSQL world to be very limiting so far.

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

    Any tutorials about cloud firestore?

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

    How to query for a key at different copies without events

  • @Трай
    @Трай 6 лет назад

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

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

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

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

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

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

    how to query using a url and get the users based on name

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

    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 !

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

      Good question.. since name being the primary key.. have you found a solution to this ? lemme know .. cheers

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

    How do I search for a particular word in string? In sql like operator

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

    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.

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

    is there any tutorials on cloud firestore.

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

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

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

    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...

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

      I suggest using stackoverflow for technical questions. RUclips does not support this well.

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

    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.

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

    how to order desc??

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

    Perfect, congratulations.

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

    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)```

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

    and how do you covert like (‘abc%)

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

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

  • @foreignworker-2163
    @foreignworker-2163 5 лет назад

    only node.js works but not python???

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

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

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

    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...

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

      that's not an error it's just a tip

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

    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. :)

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

    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

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

      There needs to be locale-aware comparison/collation, but I don't know if Firebase has that.

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

    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.

  • @funmedia4579
    @funmedia4579 6 лет назад +3

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

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

    hi dude how to order by desc in firebase

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

    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

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

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

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

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

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

    how to get column name firebase select query in javascript

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

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

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

    awesome..

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

    None of these codes works anymore while these videos are still on the website. Amazed by the lack of support given that almost everything with the firebase database documentation found on the web is deprecated.

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

    2016?

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

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

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

      Odair Seixas I think it's startAt("John")

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

      Odair Seixas see my answer for rey

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

      Odair Sixas I performed it doing this:
      docDB.orderByChild('your-document')
      .startAt('John')
      .endAt('John\uf8ff')
      But I could'n perform something like "name like '%John%'.

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

    Good

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

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

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

      you found a solution?

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

    i love you man

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

    Thanks!!!

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

      Your comments is a week ago and the video was released just today! #tf

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

      I don't think they support themselves with fake accounts if that's what I'm thinking

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

    This code doesn't work no more

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

    great content do you guys work for google to teach?

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

    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

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

    Hey David East, please help out on this below

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

    Its not working for meeeeeeeeee HEELLPPP

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

    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.

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

      Ironically, I think Parse was absorbed and became Firebase. But still, this is funny