我正在尝试通过单击按钮删除用户。我的删除功能就是这个:
deleteUser(){
const user = firebase.auth().currentUser;
this.usersRef.delete(user.uid).then(function() {
// User deleted.
console.log("User deleted")
}).catch(function(error) {
// An error happened.
console.log("User NOT deleted")
});
}
但我有这个错误:
this.usersRef.delete is not a function
答案 0 :(得分:0)
改变这个:
this.usersRef.delete(user.uid).then(function() {
进入这个:
this.usersRef.remove().then(function() {
更多信息:
https://firebase.google.com/docs/database/web/read-and-write#delete_data