title: Firebase database rules, only allow delete if the document property equals the authenticated user id
body: <p>I'm having trouble adding security rules in my firebase db. I want to only allow deleting of votes if the authenticated user is equal to the uid property on the vote document. Everything works fine EXCEPT for the delete rule I have created on match /votes/{voteId}.</p>
  
  <p>I tried to do this with resource.data.uid but the Simulator complains and I get the error "Error running simulation - Error: simulator.rules Null value error"</p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
  
      match /polls/{pollId} {
        allow read;
        allow delete: if getUserData().roles.keys().hasAny(['admin']);
        allow create: if isSignedIn();
      }
  
      match /users/{userId} {
          allow read, write: if isOwner(userId);
      }
  
      match /votes/{voteId} {
          allow read;
        allow create: if isSignedIn();
        allow delete: if request.auth.uid == resource.data.uid;
      }
    }
  
    /// Functions ///
    function isSignedIn() {
      return request.auth != null
    }
  
    function isOwner(userId) {
      return request.auth.uid == userId
    }
  
  }
  </code></pre>
  
  <p>Update</p>
  
  <p>I also tried using the /{document=**} wildcard and it gave me the same Null value error</p>
  
  <pre><code>match /votes/{document=**} {
          allow read;
        allow create: if isSignedIn();
        allow delete: if request.auth.uid == resource.data.uid;
      }
  </code></pre>
  
  <p>I also tried using the get() function but received the error "Function not found error: Name: [get]</p>
  
  <pre><code>match /votes/{voteId} {
    allow read;
    allow create: if isSignedIn();
    allow delete: if get(/databases/$(database)/documents/votes/$(voteId)).data.uid == request.auth.uid
  }
  </code></pre>