I have no idea how do I get the data("age") in unique key(generated by push()) here is my code
var dbRef = firebase.database().ref('test');
var a = dbRef.push().set({name: "apple", age: "12", sex: "male"});
dbRef.on('value', snap => {
console.log(snap.val()); //I want to get age: "12" !!
});
here is the output(from console)
Object { -Kfq7woK-DmUsZ728lgF: Object }
please help me!
Aucun commentaire:
Enregistrer un commentaire