title: Getting all documents from one collection in Firestore
body: <p>Hi I'm starting with javascript and react-native and I'm trying to figure out this problem for hours now. Can someone explain me how to get all the documents from firestore collection ?</p>
  
  <p>I have been trying this: </p>
  
  <pre><code>async getMarkers() {
    const events = await firebase.firestore().collection('events').get()
      .then(querySnapshot =&gt; {
        querySnapshot.docs.map(doc =&gt; {
          console.log('LOG 1', doc.data());
          return doc.data();
        });
      });
    console.log('LOG 2', events);
    return events;
  }
  </code></pre>
  
  <p>Log 1 prints all the objects(one by one) but log 2 is undefined, why ?</p>