title: How to return document in collection firebase using nodejs
body: <p>I using firebase my collection and document look like</p>
  <p>Collections : Users =&gt; Document : UUID (UKLDKHD...) include field :</p>
  <pre><code>{
  phone_number : 123456
  }
  </code></pre>
  <p>In collections users , i have 10 document</p>
  <p>Because firebase not support query with undefined , so i write code get all document and filter it :</p>
  <p>This is my code</p>
  <pre><code>let phoneNumber = await getPhone().where('phone_number', '==', req.phone_number).get();
  if (!phoneNumber.empty) {
    await handleLogic(phoneNumber)
  }
  
  async function handleLogic(phoneNumber) {
     
    phoneNumber.docs.map(async doc =&gt; {
          if (doc.exists &amp;&amp; doc.data().deteted_at === undefined) {
            return doc.data
          }
        }
    )
  }
  </code></pre>
  <p>But when i call function  <strong>await handleLogic(phoneNumber)</strong> , it return me undefined. I can't understand why ? But when i put log in function</p>
  <pre><code>phoneNumber.docs.map(async doc =&gt; {
              if (doc.exists &amp;&amp; doc.data().deteted_at === undefined) {
                 console.log(doc.data())
                return doc.data
              }
            }
        )
  </code></pre>
  <p>it show me correct doc i want get. But when return , it undefined . Please help thanks you</p>