June 2018
Beginner to intermediate
394 pages
9h 2m
English
We explored match rules in Chapter 5, Arsenal for Your Files, Firebase Cloud Storage. Similarly, Firestore uses the same rules syntax and principles with a few updates.
Firestore rules always start with the following rule syntax:
service cloud.firestore { match /databases/{database}/documents { // ... }}
The basic read/write rules will consist of a match statement of a specific document and allow expression for detailing when reading that specified data is allowed:
service cloud.firestore { match /databases/{database}/documents { // Match any document in the 'cities' collection match /cities/{city} { allow read: if <condition>; allow write: if <condition>; } }}
Granular operations can be implemented with the help of get and ...
Read now
Unlock full access