I am trying to check based on a document field, I am trying this:
match /usuarios/{user}/{documents=**} {
allow read, write: if user.data.uid.matches(request.auth.uid)
}
I am getting this error
Invalid type. There is no type for variable 'user' that satisfies all clauses.
You can access your document data using resource:
match /usuarios/{user}/{documents=**} {
allow read, write: if resource.data.uid.matches(request.auth.uid)
}