How do we do this now:
import "firebase/database"
await firebase
.database()
.ref('users/' + auth.currentUser.uid)
.update({
displayName: displayName
});
How do we do this now:
import "firebase/database"
await firebase
.database()
.ref('users/' + auth.currentUser.uid)
.update({
displayName: displayName
});
Share
Improve this question
edited May 17, 2021 at 13:23
Nikos
asked May 17, 2021 at 7:50
NikosNikos
7,55110 gold badges57 silver badges96 bronze badges
1 Answer
Reset to default 9That should do:
import firebase from "firebase/pat/app";
import {update, ref, getDatabase} from "firebase/database"
const app = firebase.initializeApp(firebaseConfig);
const db = getDatabase(app)
const dbRef = ref(db, `users/{userUid}`)
update(dbRef, {displayName: "Firebase9_IsCool"}).then(() => {
console.log("Data updated");
}).catch((e) => {
console.log(e);
})