title: Listen to updates on certain query with array fields on Cloud Firestore (Android)
body: <p>The picture below shows the data structure for the simple chat application. A channel is created between two users when they want to communicate. Member string array field lists the usernames. </p>
  
  <p>I want to notify the user when any of the channels of logged in user receive a message. Not sure how this can be done.</p>
  
  <p>I tried below query with no success. Any ideas? </p>
  
  <pre><code>    listenerRegistration2 =
              firebaseFirestore.collection(COLLECTION_CHANNELS)
                      .whereEqualTo("members.0", username)
                      .addSnapshotListener((queryDocumentSnapshots, e) -&gt; {
                          Log.d("myApp", "queryDocumentSnapshots = ");
                      });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/DMJE8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DMJE8.png" alt="enter image description here"></a></p>