Currently, I am conducting an experiment on login functionalities using Firebase. So far, I have succeeded in creating user accounts and storing additional information along with them. However, I am facing a challenge when it comes to retrieving this stored information.
To retrieve the data, I have utilized the following code snippet:
usersRef.on("value", function(snapshot) {
console.log(snapshot.val())
}, function (errorObject) {...});
Upon executing this code, I observed that I received two entries (due to having two accounts):
-JrrzEOqZQU0HVeYVXCm: Object
, containing uid: "simplelogin:21"
-JrrzgOgQY2z6tNYN0BY: Object
, containing uid: "simplelogin:22"
The crucial information that I require is nested inside the second object:
I specifically need the data associated with simplelogin:22
.
Could someone advise me on how to search within these objects based on their uids and access the remaining information stored within each object?
Feel free to check out the JSFiddle link here.