title: chain embedded relation between 3 collation in mongodb
body: <p>I'm trying to fetch data from 3 collection by embedded relation in mongodb.</p>
  <p>user_collection :</p>
  <pre><code>{
      _id:1,
      name:&quot;Noah&quot;,
      city_id:2,
      job_id:3
  },
  {
      _id:2,
      name:&quot;Oliver&quot;,
      city_id:2,
      job_id:1
  },
  {
      _id:3,
      name:&quot;William&quot;,
      city_id:1,
      job_id:3
  },
  </code></pre>
  <p>city_collection :</p>
  <pre><code>{
      _id:1,
      name:&quot;Tokyo&quot;,
  
  },
  {
      _id:2,
      name:&quot;Mexico City&quot;,
  
  },
  {
      _id:3,
      name:&quot;Los Angeles&quot;,
  
  },
  </code></pre>
  <p>job_collection :</p>
  <pre><code>{
      _id:1,
      title:&quot;Architect&quot;,
  },
  {
      _id:2,
      title:&quot;Barista&quot;,
  },
  {
      _id:3,
      title:&quot;Farmer&quot;,
  },
  </code></pre>
  <p>i have this 3 collection and want to list my user by city and set theirs job in user part of returned JSON</p>
  <p>i want to fetch a nested JSON.</p>
  <blockquote>
  <p>city_collection to user_collection to job_collection</p>
  </blockquote>
  <p>like this :</p>
  <pre><code>[
      {
          _id:1,
          name:&quot;Tokyo&quot;,
          users:[{
              _id:3,
              name:&quot;William&quot;,
              job:[{
                  _id:1,
                  title:&quot;Architect&quot;,
              }]
          }]
      
      },
      {
          _id:2,
          name:&quot;Mexico City&quot;,
          users:[{
              _id:1,
              name:&quot;Noah&quot;,
              job:[{
                  _id:3,
                  title:&quot;Farmer&quot;,
              }]
          },
          {
              _id:2,
              name:&quot;Oliver&quot;,
              job:[{
                  _id:1,
                  title:&quot;Architect&quot;,
              }]
          }]
      
      },
      {
          _id:3,
          name:&quot;Los Angeles&quot;,
          users:[]
      
      },
  ]
  </code></pre>
  <p>i use <em>$lookup</em> but it did not return what i want.</p>