So basically,I have a web application that uses firebase database. and I am having a hard time on how to access the encircled
ones?
here is my code:
function getDataFirebase() {
return new Promise(function(resolve, reject){
refReview.on("value", async function(snap){
var data=snap.val();
console.log("awdaw",data);
})
})
}
Loop over snapshot returned from firebase to get values inside the object.
function getDataFirebase() {
return new Promise(function(resolve, reject){
refReview.on("value", async function(snap){
let rootkey = snap.key
console.log(rootkey)
snap.forEach(snapshot => {
let childKey = snapshot.key
console.log(childKey)
Object.keys(snapshot.val()).map(k => {
console.log(snapshot.val()[k])
})
})
})
})
}
This case falls when we don't know the value of generated timestamps from firebase as child nodes.