prevent fieldvalue increment to go negative firestore code example
Example: Firestore decrement field
const userRef = db.collection('documents').doc('document_id');
const decrement = firebase.firestore.FieldValue.increment(-1);
userRef.update({ fieldToDecrease: decrement });