How to Allow Users only to write to their own document and fields in firestore?
NOTICE!
I have changed uid to email instead.
This is rules I have tried but not working:
service cloud.firestore {
match /databases/{database}/documents {
match /users/request.auth.token.email {
allow write: if get(path("databases/" + database + "/documents/users/" + request.auth.token.email)).data.uid == request.auth.uid;
}
}
}
