Angularfire对我来说是新的。
我有以下用户' firebase中的数据库
{
"users" : {
"OXdf2BB0ZSO9eGAWGaeeHMAIz7k2" : {
"displayName" : "nirmal",
"email" : "nirmal@gmail.com",
"username" : "nirmal"
},
"kuuVEQHTrZgFyv9WZmfYhNJnUSf1" : {
"displayName" : "Mehul",
"email" : "mehul@gmail.com",
"username" : "malimehul"
}
}
}
我想通过电子邮件ID获取用户并更新它或在用户中添加新属性。
像:
var userQuery = firebase.database().ref().child("users").orderByChild('email').equalTo('nirmal@gmail.com');
userQuery.on("child_added", function (snap) {
console.log('snap', snap.val());
//want to updating the user is received?, want to add phone property in received user
})
所以,想在用户中添加手机属性(nirmal@gmail.com): 更新后用户(nirmal@gmail.com)用户对象应如下所示
"OXdf2BB0ZSO9eGAWGaeeHMAIz7k2" : {
"displayName" : "nirmal",
"email" : "nirmal@gmail.com",
"username" : "nirmal",
"phone":"xxxxxxxxxx"
}
有可能在angularfire?
那么,如何通过电子邮件ID获取用户并在angularfire中更新它?
答案 0 :(得分:1)