Check out example codes for "Firestore decrement field". It will help you in understanding the concepts better.

Code Example 1

const userRef = db.collection('documents').doc('document_id');
const decrement = firebase.firestore.FieldValue.increment(-1);

userRef.update({ fieldToDecrease: decrement });

Learn ReactJs, React Native from akashmittal.com