FS DB Rule for on Document only

Advertisements
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
          //Setting condition to col1 documents
      match /col1/{document}{
          //Checking if the requested document is doc1, then let read write
           allow read,write : if document=="doc1";
      }
      match /{document=**}{
          // anything else read/write requested will be rejected
          allow read,write : if false;
      }
  }
}