from what I understand I'm doing the exact replica of Firestore's sample but I get the error:
'Argument type {isDismissed: boolean} is not assignable to parameter type UpdateData<{isDismissed: boolean}> '
when I use updateDoc in example below, it doesn't update the database when run. I'm using web version 9.
const dismissPatientAlert = (alertId) => {
alert(alertId)
const docRef = doc(db, 'Alerts', alertId);
updateDoc(docRef, {isDismissed: true})
return 'dismissed alert';
};
my samples source: https://firebase.google.com/docs/firestore/manage-data/add-data#update-data Any insight will be appreciated, thanks
did you try to use setDoc instead ?
const dismissPatientAlert = (alertId) => {
alert(alertId)
const docRef = doc(db, 'Alerts', alertId);
setDoc(docRef, {isDismissed: true},{merge:true})
return 'dismissed alert';
};