Security
NoSQL Schema
Recommended schema is having the userId somewhere in the file path, and updating the Security Rules like so:
Sub-collections
If you use something like {allPaths=**}
, this also includes subcollections. If you have set up conditionals based on the response
object, you will need to ensure that the condition exists at every level. For example:
This will expect even subcollections that matched with {allPaths=**}
to have a field role
. In order to get around this you want to set a full path:
https://medium.com/@khreniak/cloud-firestore-security-rules-basics-fac6b6bea18e
Last updated