Как получить ключ, где UID
будет равен: firebase.auth().currentUser.uid
, потому что я могу обновить эту информацию, когда пользователь вводит новые данные.
Как обновить информацию?Я использую orderByChild
и равно и установлено, но не работает.
![enter image description here](https://i.stack.imgur.com/oiznA.png)
Мой код:
updateUserInformation() {
var ref = firebase.database().ref('/users/');
ref.on('value', (snapshot) => {
snapshot.forEach((child) => {
if (child.val().UID == firebase.auth().currentUser.uid) {
this.profileData = [{
name: child.val().name,
lastname: child.val().lastname,
phone: child.val().phone,
direction: child.val().direction,
followQuantity: child.val().followQuantity,
points: child.val().points,
sex: child.val().sex,
}];
this.cdRef.detectChanges();
}
});
})
}