title: Firestore .get() inside .map
body: <p>I have a two-step firebase firestore codes. The first step grabs all the users online, and the second check learning_language is equal. The first steps generates a map loop to traverse through all the online users. But the console.log at the end returns an empty array.</p>
  
  <pre><code>        db.collection(ns_status).where("state", "==", "online").onSnapshot(function(snapshot) {
            var ns_match = snapshot.docs.map(function(userSnapshot) {
              db.collection(ns_profile).doc(userSnapshot.id).get().then(function(doc) {
                spoken_language = doc.data().spoken_language;
                if (learning_language == spoken_language) {
                  return (userSnapshot.id);
                }
              })
            })
            console.log(ns_match);
          })
  </code></pre>
  
  <p>How do I grab the properly stored array at the end? I feel that it is an asynchronous problem.</p>
  
  <p>Thanks in advance.</p>