Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Firestore decrement field

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

userRef.update({ fieldToDecrease: decrement });
 
PREVIOUS NEXT
Tagged: #Firestore #decrement #field
ADD COMMENT
Topic
Name
1+9 =