title: What is the role of doc.data() in Firebase?
body: <p>I'm building a simple page where I want to render all items from FireStore documents. However, I do not understand what exactly FireStore provides. Is it a promise, object or something different? </p>
  
  <p>Standard functon uses doc.data() to get the information. Can somebody explain why it happens? What exactly doc.data() does? </p>
  
  <pre><code>db.collection("cities").get().then(function(querySnapshot) {
      querySnapshot.forEach(function(doc) {
          // doc.data() is never undefined for query doc snapshots
          console.log(doc.id, " =&gt; ", doc.data());
      });
  });
  </code></pre>