Firestore security rules check if reference exists
In this line:
allow create, update: if isAdmin(request.auth.uid) && validate(request.resource.data)
instead of calling "request.resource.data", you should just call "resource.data":
allow create, update: if isAdmin(request.auth.uid) && validate(resource.data)
As mentioned here, the resource variable represent the Firestore document, whereas the "request" variable represents the request being made at that path, thus not containing information about the actual values in the document.
Give it a try and let me know if it doesn't work for your.
You can check if the resource already exists by using resource == null
or resource != null
Example:
allow write: if resource == null //Only can create, not update