title: How to listen for real-time updates on a list of documents in Firestore?
body: <p>Currently, I'm using <code>get()</code>, to grab some documents from Firestore. This is my code:</p>
  <pre><code>val ids = getIds()
  val tasks: MutableList&lt;Task&lt;DocumentSnapshot&gt;&gt; = mutableListOf()
  for (id in ids) {
      tasks.add(collRef.document(id).get())
  }
  Tasks.whenAllSuccess&lt;DocumentSnapshot&gt;(tasks).addOnCompleteListener { task -&gt;
      if (task.isSuccessful) {
          for (doc in task.result!!) {
              Log.d(&quot;TAG&quot;, doc.getString(&quot;name&quot;))
          }
      }
  }
  </code></pre>
  <p>And it works fine. <code>getIds()</code> returns a list of 25 Ids, so the result in the <strong>Logcat</strong> is 25 names. But this code only gets the data once, meaning that if something is added, I don't get it unless I reload the activity. I read about <a href="https://firebase.google.com/docs/firestore/query-data/listen#listen_to_multiple_documents_in_a_collection" rel="nofollow noreferrer">listen to multiple documents in a collection</a>, but this meant to be used with a query. I tried:</p>
  <pre><code>Tasks.whenAllSuccess&lt;DocumentSnapshot&gt;(tasks).addSnapshotListener()
  </code></pre>
  <p>But Android Studio is complaining with:</p>
  <pre><code>Unresolved reference: addSnapshotListener
  </code></pre>
  <p>How can I listen for real-time updates for all 25 documents? Thanks</p>