title: Firestore transaction with query issue
body: <p>I am trying to run a transaction which requires to get the data from a query:</p>
  <pre><code>firestore
            .runTransaction((transaction) =&gt; {
              const query = firestore
                .collection(&quot;Lottories&quot;)
                .doc(&quot;R3DYubrqFbbVfQNjYXfh&quot;)
                .collection(&quot;sets&quot;)
                .where(&quot;isAvailable&quot;, &quot;==&quot;, false)
                .limit(1);
              return transaction.get(query).then((snapshot) =&gt; {
                const ticketDoc = snapshot.docs[0];
                const ticketDocData = ticketDoc.data();
                const lottoUpdate = firestore
                  .collection(&quot;Lottories&quot;)
                  .doc(&quot;R3DYubrqFbbVfQNjYXfh&quot;)
                  .collection(&quot;sets&quot;)
                  .doc(ticketDoc.id);
                const ticketUpdate = firestore
                  .collection(&quot;UserLotto&quot;)
                  .doc(userId)
                  .collection(&quot;tickets&quot;)
                  .doc(&quot;abc&quot;);
                const countUpdate = firestore
                  .collection(&quot;UserData&quot;)
                  .doc(userId);
                transaction.update(lottoUpdate, { isAvailable: true });
                transaction.update(countUpdate, {
                  ticketCount: ticketCount - 2,
                });
                transaction.set(ticketUpdate, {
                  ticketId: ticketDoc.id,
                  lottoId: &quot;abc&quot;,
                  claimed: false,
                });
  
                return ticketDocData;
              });
            })
            .then((ticketDocData) =&gt; {
              console.log(
                &quot;Transaction successfully committed!&quot;,
                ticketDocData
              );
              setPopScreen(&quot;ticketPurchased&quot;);
            })
            .catch((error) =&gt; {
              console.log(&quot;Transaction failed:&quot;, error);
            });
  </code></pre>
  <p>For my application I need to run a query in order to complete my transaction. I Get the error:</p>
  <blockquote>
  <p>Transaction failed: [FirebaseError: Function Transaction.get() requires its first argument to be a DocumentReference, but it was: a custom t object]</p>
  </blockquote>
  <p>I understand transaction requires a document reference. Is there a work around this?</p>