firestore decrement field

Solutions on MaxInterview for firestore decrement field by the best coders in the world

showing results for - "firestore decrement field"
Eléonore
27 Feb 2020
1const userRef = db.collection('documents').doc('document_id');
2const decrement = firebase.firestore.FieldValue.increment(-1);
3
4userRef.update({ fieldToDecrease: decrement });