I want to Delete an index in my array in firebase (firestore) in React Native

Viewed 42

My Data in Firestore is looked as

enter image description here

I want to to Delete Math Subject

I use below Code to delete an index

firestore()
      .collection('users')
      .doc(id)
      .update({Subject: firestore.FieldValue.arrayRemove("Math")})
      .then(() => {
        console.log('Document successfully updated!');
      })
      .catch(error => {
         console.log(error);
      });
0 Answers
Related