title: firebase firestore rules authenticated access to all collections except one
body: <p>I have the following firestore structure, basically 3 collections</p>
  
  <p>publicdata
  protecteddata1
  protecteddata2</p>
  
  <p>I want to have protecteddata1 and protecteddata 2, and really the entire firestore database as authenticated users only. 
  But i want the public to have readonly access to 'publicdata' collection.. </p>
  
  <p>The following is my attempt but it doesn't work </p>
  
  <pre><code>rules_version = '2';
  service cloud.firestore {
    match /databases/{database}/documents {
      match /{document=**} {
        allow read;
        allow write: if (request.auth.uid != null);
      }
      match /publicdata {
         allow read;
      }
    }
  }
  </code></pre>