I am try to update
a field in firestore but I can't find the right call:
changeAlertState(senderId, receiverId, alertType, bool){
let type = alertType == 'toBe' ? 'toBeAlerted' : 'toAlert';
this.afs.firestore
.collection("books")
.doc(senderId + '/' + receiverId)
.update({
[type]: bool
})
.then(() => {
console.log("Contact " + receiverId + " alert successfully updated!");
});
}
I get this error:
FirebaseError: [code=invalid-argument]: Invalid document reference. Document references must have an even number of segments, but books/33KlbrBypXMe888vpO7dXgDVrfY2/hLh7Ao7IABZBukEpGFK1I8lq1rx1 has 3