title: Firestore write security rule for specific user using auth names
body: <p>New to Firestore security rules and is trying to understand it. I'm trying to write a security rule that allow only <code>admins</code> in my collection to write data and every one to read it.</p>
  
  <p>The collection of <code>admins</code> has document ids as admin names, that is for example, "Mary Lane". Within the documents I've fields:</p>
  
  <pre><code>email: "userMailId@mail.com"
  uId: "firestore_user_Id"
  </code></pre>
  
  <p>The <code>uId</code> is the id of Firestore user id. The data to write is an object <code>Message</code> and is:</p>
  
  <pre><code>new Message(uId, title, messageBody, timestamp)
  </code></pre>
  
  <p>Currently I'm trying to match the <code>request.auth.uid</code> with the id of the <code>admins</code> that are stored within the collection:</p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
      match /{document=**} {
        allow read;
        allow write: if request.auth.uid == resource.data.uId;
      }
    }
  }
  </code></pre>
  
  <p>Is this is write or am I doing something wrong. Any help is appreciated.</p>