title: Adding a map to an array on Firestore Android
body: <p>I'm having a little trouble getting my data to save to a Firestore database. Each document in my &quot;meetings&quot; collection has a list of users (maps), but I cannot seem to add anything or create a new document. I read the documentation, and it said to use FieldValue.arrayUnion(), which I tried:</p>
  <pre><code>    private fun addUserToMeeting(user: User) {
          val meetingRef = database.collection(&quot;meetings&quot;).document(meetingID.toString())
  
          val userData = hashMapOf(
              &quot;email&quot; to user.email,
              &quot;latitude&quot; to user.latitude,
              &quot;longitude&quot; to user.longitude,
              &quot;token&quot; to user.token,
              &quot;username&quot; to user.username
          )
  
          meetingRef.update(&quot;users&quot;, FieldValue.arrayUnion(userData))
      }
  </code></pre>
  <p>This is called anytime an &quot;add user to meeting&quot; button is clicked.</p>
  <p>Here's a picture of my schema: <a href="https://i.stack.imgur.com/36eyi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/36eyi.png" alt="enter image description here" /></a></p>
  <p>Has anyone got some suggestions on what I might be doing wrong?</p>