title: firebase firestore check if document with property and value exists
body: <p>I am currently trying to verify before a user creates data in the database if the data exists. Even unter an other Document id.</p>
  
  <p>Like this: User creates data, firestore rules gets all documents in collection and checks if the property <code>name</code> is the same as from the user provided. If yes, return unauthorized access.</p>
  
  <p>At this point I have:</p>
  
  <pre class="lang-js prettyprint-override"><code>function checkIfCatExists(){
        return get(/databases/$(database)/documents/category/$(documents)).data.name != null;
      }
  </code></pre>
  
  <p>But this does not work. Do you guys have an idea? I could create a function for that but I want to do as much as possible with rules.</p>