title: How to get the document ref to a where clause firestore?
body: <p>How can I get a reference to the results of a <code>where</code> clause? My database is structured like this:</p>
  <pre><code>- Restaurants
       - Restaurant 1
           - Ratings (sub collection)
           - Statistics
  </code></pre>
  <p>So I have a restaurants collection where each doc is specific restaurant. And in each doc, there is a subcollection called ratings.
  I'm trying to get a document reference to restaurant 1 so I can add some general statistics to it, and also a reference to the subcollection so I can add a rating. I'm currently stuck on getting a reference to the restaurant 1 because I use a where clause, which doesn't return a reference.</p>
  <pre class="lang-js prettyprint-override"><code>var restaurantRef = firestore.collection(&quot;restaurants&quot;).where(&quot;name&quot;, &quot;==&quot;, &quot;Neubig Hall&quot;)
  
    function addFeedback(data) {
      return firestore.runTransaction((transaction) =&gt; {
        var feedbackRef = restaurantRef.get().then(snapshot =&gt; {snapshot.forEach(doc =&gt; doc.ref.collection(&quot;feedback&quot;))});
  </code></pre>
  <p>It's saying <code>restaurantRef</code> is not a document reference. I'm using this in a React Native app.</p>