title: How to Get Data from two collection in faunadb
body: <p>I am new to faunadb. I am having trouble with querying data from two collections.
  I have a user collection with the following data.</p>
  <pre><code>
      {
         &quot;ref&quot;: Ref(Collection(&quot;users&quot;), &quot;286520131377445052&quot;),
         &quot;ts&quot;: 1609505740440000,
         &quot;data&quot;: {
            &quot;userId&quot;: &quot;f35fdc8d-6197-4d19-bf27-256bd41b3751&quot;,
            &quot;name&quot;: &quot;PRANTA Dutta&quot;,
            &quot;email&quot;: &quot;pranta@email.com&quot;,
            &quot;role&quot;: &quot;borrower&quot;,
            &quot;password&quot;: &quot;somepassword&quot;
         }
      }
  
  </code></pre>
  <p>Then I have a loan collection with the following data</p>
  <pre><code>
      {
         &quot;ref&quot;: Ref(Collection(&quot;loans&quot;), &quot;287038065061397005&quot;),
         &quot;ts&quot;: 1609999680495000,
         &quot;data&quot;: {
            &quot;monthlyInstallment&quot;: 473.33,
            &quot;loanDuration&quot;: 6,
            &quot;interestRate&quot;: 7,
            &quot;amount&quot;: 2000,
            &quot;modifiedMonthlyInstallment&quot;: 513.33,
            &quot;mode&quot;: &quot;processing&quot;,
            &quot;userId&quot;: &quot;f35fdc8d-6197-4d19-bf27-256bd41b3751&quot;
        }
  }
  
  </code></pre>
  <h3>Important: Loans and Users Collection have a one to many relations and a user can request multiple loans.</h3>
  <p>Now I want to write a query to fetch the loan data with matching userId at once so I can show all the data altogether.</p>
  <p>The Data I want is the following:</p>
  <pre><code>   &quot;data&quot;: {
         &quot;monthlyInstallment&quot;: 473.33,
         &quot;loanDuration&quot;: 6,
         &quot;interestRate&quot;: 7,
         &quot;amount&quot;: 2000,
         &quot;modifiedMonthlyInstallment&quot;: 513.33,
         &quot;mode&quot;: &quot;processing&quot;,
         &quot;userId&quot;: &quot;f35fdc8d-6197-4d19-bf27-256bd41b3751&quot;,
         {
            &quot;data&quot;: {
               &quot;userId&quot;: &quot;f35fdc8d-6197-4d19-bf27-256bd41b3751&quot;,
               &quot;name&quot;: &quot;PRANTA Dutta&quot;,
               &quot;email&quot;: &quot;pranta@email.com&quot;,
               &quot;role&quot;: &quot;borrower&quot;,
               &quot;password&quot;: &quot;somepassword&quot;
            }
         }
     }
  </code></pre>
  <p>How can I do that using FQL, Thanks in Advance.</p>