I'm trying to figure out how to loop through sent_request child which is inside users table and get all user_keys. I tried many ways but it's not working.
table structure:
here is my code:
getProfileData(emailID)
{
var ref = firebase.database().ref('users');
ref.orderByChild("email").equalTo(emailID).once("value", (items : any) => {
let sent_request : any = [];
items.forEach((item) => {
sent_request = item.val().sent_request;
});
console.log(sent_request);
});
}
console.log(sent_request) output:
How to get user_key from these records? because I want to pass these each user_key to another method and get records based on that user_key. Please help. Thanks in advance.