0
I have the following JSON
"colecao" : {
"id" : {
"subid1" : 2,
"subid2" : 1
}
}
I use the following commands to retrieve data from the Altime
var dbrealtime = firebase.database();
var query = dbrealtime.ref('colecao');
query.on('value', function(snapshot) {
console.log(snapshot.val().id);
});
If I do it will take the value "2";
console.log(snapshot.val().id.subid1);
I would like to do a foreach and show the two values that have in id without having to reference subid1 and subid2.
Example:
2
1