title: Get one document from Firestore and return it to a variable
body: <p>I have less experience with NodeJS, but I am trying to obtain one User document from Firestore.</p>
  <pre><code>const fs = firebase.firestore();
  const usersRef = fs.collection('users');
  
  
  let findUserByContact = (contact) =&gt; {
      let res = usersRef.where('contact', '==', contact).get().then(querySnapshot =&gt; {
          if (!querySnapshot.empty) {
              return querySnapshot.docs[0].data();
          } else {
              return false;
          }
      });
  };
  </code></pre>
  <p>I am trying to return the first document thats found. However that will always returns undefined when I am calling <code>findUserByContact</code>.</p>
  <p>I could use <code>console.log</code> to see the output of my query. But I can't manage to assign it to a variable.</p>
  <p>I've read into Promises, and I saw that it has to resolve something. I was trying to call <code>resolve</code> with the data I wanted to return but that gave me an error as wel.</p>