title: iterate through multiple document with certain doc id from a collection
body: <p>hope you are coding well, I am using firebase and vue js to build a messenger application.
  Each user has a document, and within each document there is a field named includeInMsg, which contains the Id of the message that the user included. I know how to read one document by its id, but I don't know how to read multiple documents by their ids.
  here you can see my code:</p>
  <pre class="lang-js prettyprint-override"><code>import { ref } from &quot;vue&quot;;
  import { db } from &quot;src/boot/firebase&quot;;
  import { getAuth, onAuthStateChanged } from &quot;firebase/auth&quot;;
  import { updateDoc, arrayUnion, arrayRemove } from &quot;firebase/firestore&quot;;
  import {
    addDoc,
    collection,
    query,
    where,
    getDocs,
    getDoc
  } from &quot;firebase/firestore&quot;;
  import { doc, onSnapshot } from &quot;firebase/firestore&quot;;
  
  export default {
    setup() {
      return {
        userList: ref([]),
        userMessageRefList: ref([]),
        userMessageDocList: ref([]),
        freelancerProfile: ref([]),
        messages: ref([]),
        userMessage: ref([]),
        listofdata: ref([])
      };
    },
    async created() {
      // check if user loged in or not
      const auth = getAuth();
      onAuthStateChanged(auth, user =&gt; {
        if (user) {
          // store current user uid in userlist
          this.userList.unshift(user.uid);
          this.renderMessageList();
        } else {
          this.$router.push(&quot;/&quot;);
        }
      });
    },
    methods: {
      // render user message list doc id
      async renderMessageList() {
        const currentUserProfile = query(
          collection(db, &quot;userProfile&quot;),
          where(&quot;uuid&quot;, &quot;==&quot;, this.userList[0])
        );
        const userProfileQuerySnapshot = await getDocs(currentUserProfile);
        userProfileQuerySnapshot.forEach(doc =&gt; {
          let docData = doc.data();
          this.userMessageRefList.unshift(docData.messageList);
          this.listofdata.unshift(docData);
        });
        this.userMessageRefList.forEach(elem =&gt;
          // store doc id into userMessageDocList
          elem.forEach(le =&gt; this.userMessageDocList.unshift(le))
        );
        console.log(this.userMessageDocList) //output: {0: {…}, 1: {…}}
        // now I need to read each document by their doc Id and store it in an array to render
  
      },
    },
    computed: {
      checkMessages: function() {
        if (this.messages.length &gt; 1) {
          return true;
        } else {
          return false;
        }
      }
    }
  };
  </code></pre>
  <p>I tried to use for loop to read each document and store the value in an array but I got <code>SyntaxError: Unexpected reserved word 'await'. (71:26)</code> error.</p>