0
Good evening, I have the following data structure:
I need to store all these Ids that are children of visits in an array to later create a loop to search for the data that each of these Ids has, but in the documentation there is no method to do this, so I found this site https://www.it-swarm.dev/pt/javascript/como-recuperar-varias-chaves-no-firebase/825394279/, there shows a very similar question, my question if there really is no other way to do it?
Note: My goal is to calculate how many tires were collected and how many were delivered per seller, so I need to access each one’s Ids,
Remembering that I am using javascript to later create a screen to consume this data follows my code:
firebase.database().ref('visitas/').on('value', function (snapshot) {
snapshot.forEach(function (item) {
console.log(document.createTextNode(item.val()));
resultado[i] = document.createTextNode(item.val());
i++;
})
});
console.log(resultado)
I used 'item.key' so returned me the key, yes I was inattentive on the payment issue, thanks for the alert and I will give a studied on 'cloud Function', i opted for firebase due to the possibility of data synchronization even with the lack of features like internet and battery, thanks even!!
– LEANDRO DA SILVA