1
I am creating a system of questions and answers, and in this system and this system I need the answers to enter an array with the name of the respondent, the value of their response and the timestamp of the time when the response was sent. Follows the code:
enviar_resposta: function(id_duvida, index){
let path = firebase.firestore().collection('database').doc(this.id_cliente).collection('assembleia').doc(this.id_assembleia).collection('duvidas').doc(this.id_duvida)
let resposta = {
respostas : [
{ nome: this.nome,
resposta:this.nova_pergunta,
data_duvida: firebase.firestore.FieldValue.serverTimestamp()
}
]
}
path.update({
resposta : firebase.firestore.FieldValue.arrayUnion(resposta.respostas[0])
})
},
My problem is in timestamp, somehow it is not allowing me to insert the timestamp data into the array, it follows the error in question:
From what I understand the error is related to some kind of timestamp problem and the fact that it is only allowed to use . set() and . update(). Does anyone know how I can solve this problem?