title: Firestore update list of object
body: <p>I'm trying to use Firestore. </p>
  
  <p>I have a collection <strong>Group</strong> which contains a List of users</p>
  
  <pre><code>    public class User {
  
      private String mail;
      private String username;
  
      public User() {
      }
  
      public User(String mail, String username) {
          this.mail = mail;
          this.username = username;
      }
  
      public String getMail() {
          return mail;
      }
  
      public String getUsername() {
          return username;
      }
  }
  </code></pre>
  
  <p>I would like to update this list so I've tried : </p>
  
  <pre><code>List&lt;User&gt; list = new ArrayList&lt;&gt;();
          list.add(new User("mail@gmail.com", "foo"));
          reference.update("users", list)
                  .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
                      @Override
                      public void onSuccess(Void aVoid) {
                          Log.d(TAG, "DocumentSnapshot successfully updated!");
                      }
                  })
                  .addOnFailureListener(new OnFailureListener() {
                      @Override
                      public void onFailure(@NonNull Exception e) {
                          Log.w(TAG, "Error updating document", e);
                      }
                  });
      }
  </code></pre>
  
  <p>But I have an exception : </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Invalid data. Unsupported type: my.package.name.models.User</p>
  </blockquote>
  
  <p>How can I update a list of object using Firestore ? </p>