title: Firestore: Query by item in array of document
body: <p>I have 2 collections <strong>&quot;photos&quot;</strong> and <strong>&quot;users&quot;</strong> and each document in <strong>&quot;users&quot;</strong> has <strong>one or more photo IDs with an array</strong>.</p>
  <pre><code>photos &gt; 5528c46b &gt; name: &quot;Photo1&quot;
           a1e820eb &gt; name: &quot;Photo2&quot;
           32d410a7 &gt; name: &quot;Photo3&quot;
  </code></pre>
  <pre><code>users &gt; acd02b1d &gt; name: &quot;John&quot;, photos: [&quot;5528c46b&quot;]
          67f60ad3 &gt; name: &quot;Tom&quot;, photos: [&quot;5528c46b&quot;, &quot;32d410a7&quot;]
          7332ec75 &gt; name: &quot;Sara&quot;, photos: [&quot;a1e820eb&quot;]
          9f4edcc1 &gt; name: &quot;Anna&quot;, photos: [&quot;32d410a7&quot;]
  </code></pre>
  <p>I want to get <strong>all users who have one or more specific photo IDs</strong>.</p>
  <p>Are there any ways to do that?</p>