title: How to Query within an array of object in Firestore?
body: <p>I'm trying to query an array of objects from my firestore database, I've tried many methods such as <code>array-contains</code>, <code>array-contains-any</code>, <code>in</code>, but to no avail.</p>
  <p>I have a users array, and it's an array of objects, each object has two properties-- id and role. I want to write a query that will selectively get a document in which the current logged in user is present in the user's array.</p>
  <pre><code>db.collection('chatRooms')
              .where(/* What am I supposed to do here */)
              .get()
              .then((snapshot) =&gt; {
                  setRooms(
                      snapshot.docs.map((room) =&gt; {
                          return { id: room.id, data: room.data() };
                      })
                  );
              });
  
  </code></pre>
  <p>Here's a snapshot of how I'm storing the data:</p>
  <p><img src="https://i.stack.imgur.com/dPwGu.jpg" alt="Here's a snapshot of how I'm storing the data" /></p>