So I have a simple database and I want to make a simple rule but for some reason it doesn't want to match my collection

service cloud.firestore {
match /databases/{database}/documents {
match /userPrivate/{user=**} {
allow read, write: if request.auth.uid == user;
}
}
}


You're not specifying the document to fetch correctly. In the text box that asks you for the location of the document, don't add /databases/(default)/documents. That is added for you automatically. You should specify the path to the document using the collection and document id. For example: /userPrivate/uid where "uid" is the document id. You should probably also turn on authentication in the simulator so that the id is matched.
Also bear in mind that when you use a wildcard match with two stars like /userPrivate/{user=**}, then user variable will contain the entire path of the document, including any subcollections. This means that you rule will not work for documents within subcollections.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With