title: Firestore Security - allow only known fields
body: <p>I can’t figure out how to properly set the ‘.validate’ rule in Firestore.
  Basically, I want to allow a User document to contain <strong>only</strong> the fields I know:</p>
  
  <pre><code>user {
   name: "John"
   phone: "2342222"
   address: "5th Avenue"
  }
  </code></pre>
  
  <p>I dont want any other fields besides the 3 above (name, phone, address).</p>
  
  <p>The fields WON’T be saved at the same time. <strong>name</strong> and <strong>phone</strong> will be saved first, and <strong>address</strong> will be saved only when user wants to edit his profile.</p>
  
  <p>I've tried the rules below but don’t seem to work:</p>
  
  <pre><code>allow read: if request.auth.uid == uid;
  allow write: if request.auth.uid == uid &amp;&amp; 
   request.resource.data.keys() in ["name", "phone", "address"]
  </code></pre>
  
  <p>Thanks for help.</p>