title: Firebase/Database - Version 2 Security Rules?
body: <p>I'm just getting started with Firebase, and notice that there are a lot of tutorials/docs that instruct you to put the following into the rules for your database:</p>
  
  <pre><code>{
    "rules": {
      "$uid": {
        ".write": "$uid === auth.uid",
        ".read": "$uid === auth.uid"
     }
   }
  }
  </code></pre>
  
  <p>However, there seems to be a new version of this code out, version 2. I was wondering if the code I have above, which is outdated and version 1 (I guess), is essentially equivalent to this code:</p>
  
  <pre><code>// Allow read/write access on all documents to any user signed in to the application
  service cloud.firestore {
    match /databases/{database}/documents {
      match /{document=**} {
        allow read, write: if request.auth.uid != null;
      }
    }
  }
  </code></pre>
  
  <p>which comes from the google firebase docs (<a href="https://firebase.google.com/docs/firestore/security/get-started" rel="noreferrer">https://firebase.google.com/docs/firestore/security/get-started</a>)</p>
  
  <p>Thanks</p>