title: list type safety in firestore security rules
body: <p>In my firestore security rules, I want to have a rule, that checks if all elements of a list are of type string.</p>
  
  <p>My "user" documents have a field called "friends". It is an list of strings, that represent the documentIDs of other user documents.
  These are my current rules:</p>
  
  <pre><code>function userIsAuthenticated() {
    return request.auth != null;
  }
  
  match /users/{userID} {
  
    function resourceIsValidUser() {
      return displayNameIsValid();
    }
  
    function displayNameIsValid() {
      return request.resource.data.displayName is string &amp;&amp;
        request.resource.data.displayName.size() &gt; 0 &amp;&amp;
        request.resource.data.displayName.size() &lt; 17;
    }
  
    function photoUrlIsValid() {
      return request.resource.data.photoUrl is string;
    }
  
    function friendsIsValid() {
      return request.resource.data.friends is list;
    }
  
    function userIsUserOwner() {
      return request.auth.uid == userID;
    }
  
    allow read: if userIsAuthenticated();
    allow write: if
      userIsAuthenticated() &amp;&amp;
      resourceIsValidUser() &amp;&amp;
      userIsUserOwner();
  
  }
  </code></pre>
  
  <p>Is there anything I could add to the <code>friendsIsValid()</code> function to ensure the friends-list only contains string-values?</p>