I've a counter in firestore that count likes. And I increment it like this:
const db = firebase.firestore();
const increment = firebase.firestore.FieldValue.increment(1);
// Document reference
const doc = db.collection('coll').doc('doc');
// Update read count
doc.update({ likes: increment });
So if someone edits the source and replaces increment with decrement, it's going to work that way. I'd like to prevent that.
How can I write a firestore-security rule for this so that the rule only allows incrementing and not decrementing?