title: How to get a single document data in a Firebase Firestore (without promises)
body: <p>im trying to get the data of a single document and save it to a variable for use it later in another logic operation. The firestore documentation show hot to do this only with promises but i can't set the doc.data() value to a variable for later use, only inside the then() or catch() method. I can set a variable there but i can't use it outside the promise.</p>
  
  <p>Firestore documentation example:</p>
  
  <pre><code>var docRef = db.collection("cities").doc("SF");
  
  docRef.get().then(function(doc) {
      if (doc.exists) {
          console.log("Document data:", doc.data());
      } else {
          console.log("No such document!");
      }
  }).catch(function(error) {
      console.log("Error getting document:", error);
  });
  </code></pre>