I'm currently in the proccess of making a web application for a university project and I need some help in retrieving a value in the Firebase database. Here is the structure:
What im trying to do is see if a specific uid is present anywhere unfer the ref 'addresses'
this is my code:
var refAdd = firebase.database().ref().child('addresses');
refAdd.orderByChild("uid").equalTo(user.uid).once("value", function(snapshot){
console.log("(snapshot) request found for " + snapshot.key);
snapshot.forEach(function(child) {
console.log("request found for " + child.key);
});
});
So what I'm trying to do here is see if ther current user UID is present under 'addresses', if it is then log the push key value where it's located.
Anyone one have any idea on how to go about it?
