0

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

my database

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

1 Answers1

0

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807