title: Writing Firestore Security Rule to Prevent Updating Documents to Null
body: <p>Is it possible to write a firestore security role that prevents a malicious user from clearing all of the data within a document via update?</p>
  
  <p>I already have rules in place to prevent document deletion, but I'm worried a user could still use the "update" section of Firestore security to update documents and clear all data using Firestore's "setData" methods.  </p>
  
  <pre><code>  match /stories/{document=**} {
        allow read, create, update: if request.auth.uid != null;
        allow delete: if request.auth.uid == resource.data.creatorID;
      }
  </code></pre>
  
  <p>Above is an example rule that I have.  Can I prevent update if the document is blank by using</p>
  
  <pre><code>resource.data != null || resource.data != "" 
  </code></pre>
  
  <p>Or something similar?  Has anyone done this?</p>