My data of usercollection looks like this:
username: "johndoe"
email: "john.doe@test.com"
firstName: "John"
lastName: "Doe"
loginUid: "...."
and this is my rule:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
I just want to read usernames from firestore, if not authenticated to check before registration, if username is already taken. Is this possible. If not, is there another way, like creating a view of all usernames, which i could read from?