firestore security rules for nested documents

Viewed 23

I have Two collections in firestore

  1. userTbl
  2. instituteTbl

In userTbl, I have store schoolid of specific user in schoolid field. Now, I want that loggedin user should able to get access of data of there schoolid only.

What I Tried

match /instituteTbl/{userTbl/userID/schoolid}/{document=**}{
      allow read, write: if true;
    }

But Its not working, Please help me with this

Screenshot of userTbl Data structure Screenshot of userTbl Data structure Screenshot of instituteTbl Data structure [Screenshot of instituteTbl Data structure]

0 Answers
Related