title: Firebase Firestore collection retrieval in React Native
body: <p>I'm building a React Native app with Expo using the Firebase web api and trying to retrieve a collection of documents from my Firestore project. According to the documentation over at <a href="https://firebase.google.com/docs/firestore/query-data/get-data" rel="noreferrer">https://firebase.google.com/docs/firestore/query-data/get-data</a> I should be able to iterate over a collection using the forEach() method provided by the collection snapshot like so:</p>
  
  <pre><code>db
  .collection('services')
  .get()
  .then(snapshot =&gt; {
    snapshot.forEach(doc =&gt; {
      if (doc &amp;&amp; doc.exists) {
        console.log(doc.id, ' =&gt; ', doc.data());
      }
    });
  });
  </code></pre>
  
  <p>This however only logs one document, despite the fact that I currently have 3 documents in the collection, what am I missing? Please help.</p>
  
  <p>My firebase config looks like so: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import * as firebase from 'firebase';
   firebase.initializeApp({
      "projectId": "my-project-id",
      "apiKey": "my-api-key",
      "authDomain": "my-project.firebaseapp.com",
      "databaseURL": "https://my-project.firebaseio.com",
      "storageBucket": "my-project-id.appspot.com/",
      "messagingSenderId": "my-messaging-sender-id"
  })
  const db = firebase.firestore();</code></pre>
  </div>
  </div>
  </p>