hello
i have this structure in firebase in which i search by "PN" would it be possible to search also by "compatible"?
these are the blocks that I use for the search
thanks in advanced
hello
i have this structure in firebase in which i search by "PN" would it be possible to search also by "compatible"?
these are the blocks that I use for the search
thanks in advanced
Once you have the data, you can search by the key you want.
Just as you are searching by PN, by doing the same, you can search by Compatible.
I'm sorry but I don't understand what you're saying, when I try to search I get the following in the app, I can only search by PN which is the list that you can see in the image
Here you have an example (you have a lot of them in the community) similar to yours. Once you call to GetValue for you tag "recambios" you can get any info:
Also, if you want to get firebase to do some of the hard work:
https://firebase.google.com/docs/database/rest/retrieve-data#section-rest-reading-data-get
now when i search for 12GYY it shows me in the red box what is marked in red in firebase
what I would like to do is to type 529FG and find it in the database structure.
529FG is not a Tag/Key so, you will have to get all the info and then search it in that recovered data or, to do what @TIMAI2 told you and implement some type of callback in Firebase (via JSONP) so that it does the job for you.
How much data will you have (eventually), how many records ?
This does everything you have asked for:
You do have to download all the data to the app. Firebase realtime database does not provide for specific queries like sql / in the way you might expect.
I tell a lie. It is possible to search on a value and return the data...
RULES (demo)
"recambios": {
".read": true,
".write": true,
".indexOn" : [".value","Compatible","Description","PN"]
},
hi Timai2
I have tried what you told me but the following occurs:
any other idea ?
thanks in advanced
What does your responseContent look like? Put it to a label.
It should look like this:
{"234BCD":{"Compatible":"BCD234","Description":"2TB HDD","PN":"234BCD"}}
(from my example data)
Have you set the indexes in the rules like I showed above ? You need these to be able to do any filtering.
you dont have the same...
"recambios": {
".read": true,
".write": true,
".indexOn" : [".value","Compatible","Description","PN"]
},