How to query with filter in Firebase?

5

I'm starting in Firebase and would like to know how to query with filter, example:

Select, only people who live in Porto Alegre.

Today, what I have is a DB structure.

I have 4 tables, street, neighborhood, city and state. The first one I posted is the table is state, the other is street / street.

    
asked by anonymous 19.07.2016 / 20:23

2 answers

2

Firebase uses a JSON-tree structure, in your case, you could create a 'child' called people, listing all the people on your system. Each person would be a knot with children content their characteristics.

firebase
   -pessoas
       -uid1
           -nome:"USER 1"
           -UF:"RS"
       -uid2
           -nome:"USER 2"
           -UF:"RS"
       -uid3
           -nome:"USER 3"
           -UF:"SC"

In your search, you can use "equalTo ()" and filter for the specific "child", in which case you could fetch all people with the child "UF" equalTo () 'RS' / p>

link

    
03.02.2017 / 11:30
-1

Firebase NOT works as a SQL Database Manager System. One of the main differences is that Firebase focuses on distributing direct data rather than on where ) and putting together join data. This means that if you are careful enough to learn how Firebase works and model your data following Firebase logic, you do not need a dedicated queries server because they are done right in the client device.

For more information, watch David East's playlist on Firebase Database for SQL Developers , available at link .

    
01.12.2016 / 04:39