问题
Here is my firebase i don't know how to enter or get that path in firebase and i want to change the password inside that random character
回答1:
To update a specific value in the database, you must know the full path to that value.
If you know the email address, but not the key that email address, you can use a query to look up all child nodes of users
with that email address.
let query = firebase.database.ref("users").orderByChild("email").equalTo("gagfa@john.com");
Then you can load the data matching this query, iterate over the results (as there can be multiple) and update the property:
query.once("value").then((snapshot) => {
snapshot.forEach((userSnapshot) => {
userSnapshot.ref.child("password").set("CorrectHorseBatteryStaple");
});
});
Unrelated to your question, but please read Why are plain text passwords bad, and how do I convince my boss that his treasured websites are in jeopardy? and reconsider storing passwords in plain text.
来源:https://stackoverflow.com/questions/58524797/i-cant-update-data-from-firebase-because-of-the-random-given-character