For a project i need to extract data from a realtime database using firebase.
My database setup is this:

now i am trying to put the fieds ‘naam’ in a listviewer.
So the outcome should be a list with 2 items: ‘Hashtag Food’ and ‘De Pepermolen’
but i am struggeling to find an answer, i searched with google but the only info i find is from people who aren’t using the crossplatform version. Can someone help me out?
The same principals apply. Firebae behaves the same. What aspect of the non classic version is not making sense?
There are two things I imagine you can do:
1 - Transform the objects inside glutenshit in a list, so you would need to put “De Pepermolen” also inside the object. But after that, when you do a Get in glutenshit, the firebase would return a list of objects for you and you just need to do a foreach on it and get the object properties.
Example:
When I do a Get on “precos”, it returns me a list of objects like this one: (note that the numbers “1” and “2” inside “precos” are just the objects indexes in the list, their are not childs of “precos”, it’s just to illustrate)
[
{
data: "04/28/2019 01:44:45",
id_local_de_compra: 1,
id_produto: 1,
valor: "11,90"
},
{
data: "04/28/2019 03:05:10",
id_local_de_compra: 1,
id_produto: 2,
valor: "10,90"
}
]
2 - Create a separate entry called “NaamProperty” and inside it you would have entries like { {“De Pepermolen” : “De Pepermoler”}, {“Hashtag Food”: “Hashtag Food”} }
Maybe one of these two videos can help you:
Shows a different way to organize your data in firebase:
This is a long one that teachs how to use all the firebase features, but it is spoken in Brazilian Portuguese:
1 Like
I want to add one more thing, If you have to come through the entire database to get your tags, there is data transfer concerns, as well as security. One of the things you can do is create a separate list in firebase of all of the Naam listed.
While it makes the database larger because you store the information twice, it groups those elements together.