Here's what I’ve written;
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /reservedUsernames/{username} {
allow update: if false;
allow create: if request.auth != null;
}
}
}
I already added a document with ID sam and a field userId = 122. If I run an update on that document, see how below, it succeeds! How can I allow creations but no updates?
db.collection("reservedUsernames")
.document(searchableUsername)
.setData(["userId": userId])