0

enter image description here

I want to delete the 0 element of questions array. I've tried this

const documentRef = db.collection(collection).doc(challengeId)
    await documentRef.update({
      [`stages.0.surveys.0.questions.0`]: firebase.firestore.FieldValue.delete()
    })

But it doesn't work. I would appreciate any help. thank you

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
user13512145
  • 45
  • 1
  • 5
  • You cannot update an array element by index. You would have to read the document, modify and update back in Firestore as mentioned in the linked answers. – Dharmaraj Oct 27 '22 at 16:03

0 Answers0