Firestore security rules: How to validate that a field is undefined?

前端 未结 2 903
迷失自我
迷失自我 2020-12-18 06:40

When a user signs up and they initialise their data in firestore, I want to validate that they aren\'t attempting to set their role (i.e. so they\'re not setting it to \'adm

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 07:10

    Try with writeFields if other solutions do not work.

    !("role" in request.writeFields)
    

提交回复
热议问题