firebase update document array code example
Example 1: update photoURL firebase
this.$fireAuth.currentUser.updateProfile({
displayName: '',
photoURL: '',
email: ''
})
.then((r) => {
console.log(r)
})
.catch((e) => {
console.log(e)
})
Example 2: firestore update array
let washingtonRef = db.collection('cities').doc('DC');
let arrUnion = washingtonRef.update({
regions: admin.firestore.FieldValue.arrayUnion('greater_virginia')
});
let arrRm = washingtonRef.update({
regions: admin.firestore.FieldValue.arrayRemove('east_coast')
});
Example 3: firebase update data
await firebase.database().ref().update(updates);