Skip to content
Advertisement

I can`t read the data after I update my rules on firestore (React Native)

the rules I set is allow read: if resource.data.uid == request.auth.uid;

how I call it is like this

JavaScript

How can i fix it?

firebase rule

JavaScript

image for the data

https://1drv.ms/u/s!Ag7uBMx2FuEijuILje2xJIv8RawcFA?e=Gy6jeC

Advertisement

Answer

Rules don’t filter data on their own. Instead they merely ensure that the data that is being requested matches your rules.

So your query needs to match the rules, which means they also need to filter by UID:

JavaScript
Advertisement