Firebase Querry

this https query returns all tables
result : {“u1”:{“age”:21,“name”:“asdf”},“u2”:{“age”:22,“name”:“qwer”},“u3”:{“age”:21,“name”:“zxcv”},“u5”:{“age”:22,“name”:“asdf”}}

this https query returns filtering by name“name”&equalTo=“asdf”
result : {“u1”:{“age”:21,“name”:“asdf”},“u5”:{“age”:22,“name”:“asdf”}}

1>what will be the format of query to filter by name and age
2>what will be the format of query to filter by name or age

fb rules:
“rules”: {
“.read”: true,
“.write”: false,
“.indexOn”: [“age”,“name”]
i don’t want to filter after downloading whole json data my DB is large

What output are you expecting for your two required queries ?

It appears you are already getting the data you want back as a json…

i want result where say name = asdf and age = 22

i want to filter 2 parameters simultaneously not filter in app

Just one record with name and age, or many/all records ?

all records that match the parameter

For example, all users that have age 22 ?

all records where age is say 22 and name asdf it could be more than one

I believe you will need to reorganise your data to do that. See here:

so data something like this:


You would also need to add the .value to your IndexOn

This is your API ?
https//hello-world ?

yes read is allowed

I’ll try to explain. Is this https: // an API?

Look orderby and equal.
The documentation says what about these parameters?
Can you filter 2 tags?"name=&equalTo=“asdf”&orderBy="age"&equalTo=22 ?

don’t think will, help what will the query like

kodular gave firebase real time db all well and good
but no way to run query
what good is db without query using web component to run querry

This should work, can’t test as you seem to have locked down your data…"age"&equalTo=22

not running
“error” : “orderBy must be a valid JSON encoded path”

Please show how you data is set out in Firebase (screenshot of data)

What documentation say about querys ?

1 Like

Able to test now, isn’t this what you want?"age"&equalTo=22
"u2": {
"age": 22,
"name": "qwer"
"u4": {
"age": 22,
"name": "zxcv"
"u5": {
"age": 22,
"name": "asdf"

yes this part works but i want to search all users whose age is 22 and name is asdf