title: Firebase firestore timestamp based security rules
body: <p>On my client side I am creating a document with one of the fields "createdDate"</p>
  
  <p>below is a payload from the firestore simulator</p>
  
  <pre><code>{
    "__name__": "/databases/(default)/documents/billing/aaaa",
    "data": {
      "createdDate": 1529237500239,
      "createdDateTimeFormat": "2018-06-12T07:00:00.000Z"
    }
  }
  </code></pre>
  
  <p>I tried to set the security rule to make sure the "createdDate" is not in the future.</p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
      match /billing/{userId}{
          allow create: if (request.resource.data.createdDate &lt; request.time.toMillis());
      }     
    }
  }
  </code></pre>
  
  <p>This gives access denied.</p>
  
  <p>Next, I tried the following rule referencing the Timestamp format. That gives access denied as well.</p>
  
  <pre><code>service cloud.firestore {
    match /databases/{database}/documents {
      match /billing/{userId}{
          allow create: if (request.resource.data.createdDateTimeFormat &lt; request.time);
      }     
    }
  }
  </code></pre>