DEV Community


Discussion on: Restrict specific fields updation in Firebase Firestore

richard_sylvest profile image
Richard Sylvester

Good article Kushagra, only one small problem. If you run your code in the firestore rule playground it will fail for fields that cannot be updated but don't exist in the document yet. The following will fix that:

function notUpdating(field) 
    return !(field in || (field in &&[field] ==[field]);
Forem Open with the Forem app