If I have a database like
users: {
user1: {
name:\'qwert\',
id: 123,
num: 9999
},
user2: {
name:\'zxcvb\',
id: 456,
num:
To retrieve only the names of the users, then try the following:
firebase.database().ref().child("users").on("value", function (snapshot) {
snapshot.forEach(function(childSnapshot) {
var name=childSnapshot.val().name;
});
});
Here the snapshot is users, then you iterate inside user1 and user2 to be able to access the names of these users and retrieve them.