title: service function firebase getDocs
body: <p>I am trying to build a firestore get function to fetch data from firestore database, I successfully fetch the data into the console, but I don't know how to return the data, as everytime that returns a promise.</p>
  <pre><code>export const getJobPostings = async () =&gt; {
    const jobPostingsRef = collection(database, &quot;jobPostings&quot;);
    const snapShot = await getDocs(jobPostingsRef);
    snapShot.forEach((item) =&gt; {
      console.log(item.data());
    });
    return snapShot
  };
  </code></pre>