0
Good people, I need to capture with javascript the name of Childs 10th of 2017 and 11de2017 from the following image database:
Initially I tried as follows:
var datasWO = firebase.database().ref().child("WO"); //acesso o primeiro child depois do ref.
datasWO.on("child_added", function (snap2){
snap2.forEach(function(childSnap){
console.log(childSnap.key); //e então mostro o nome deles
});
})
In that case he returns the names of childs
who are within 10de2017
and 11de2017
.
I’ve tried using the child.parent.key
(That logically would return me 10de2017 and 11de2017) but I get on the console an error message: Cannot read property 'parent' of undefined
. I need to list these nodes to automatically add them in a select html.