title: How can I query nested documents in mongodb
body: <p>I have a MongoDB Atlas database and in it I have an event document that looks like this. It stores owner, participants and invitees as id's of users.</p>
  <pre><code>{
      &quot;geolocation&quot;: {
        &quot;lat&quot;: 100,
        &quot;lon&quot;: 45.5
      },
      &quot;_id&quot;: &quot;62d5db5de4756cfbd3025689&quot;,
      &quot;name&quot;: &quot;other sport 2&quot;,
      &quot;description&quot;: &quot;test&quot;,
      &quot;eventType&quot;: 10,
      &quot;owner&quot;: &quot;62d5d03731abc02b8c7da79c&quot;,
      &quot;participants&quot;: [
        &quot;62d5b5b5688fec147542ae10&quot;
      ],
      &quot;invitees&quot;: [
        &quot;62d5c428ca6400ec392d2be4&quot;
      ],
      &quot;date&quot;: &quot;2012-04-23T18:25:43.511Z&quot;,
      &quot;duration&quot;: 50,
      &quot;maxPlayers&quot;: 11 
  }
  </code></pre>
  <p>Is there any way to query it to actually display the referred documents, something like a &quot;deepFind&quot; to return me this?</p>
  <pre><code>{
    &quot;geolocation&quot;: {
      &quot;lat&quot;: 256,
      &quot;lon&quot;: 345
    },
    &quot;_id&quot;: &quot;62d7ab45fda0e6ff4fbd6b29&quot;,
    &quot;name&quot;: &quot;football&quot;,
    &quot;description&quot;: &quot;11v11&quot;,
    &quot;eventType&quot;: 5,
    &quot;owner&quot;: {
      &quot;_id&quot;: &quot;62d2ebe1095c38196688e2b4&quot;,
      &quot;fullname&quot;: &quot;Mircea Feder&quot;,
      &quot;email&quot;: &quot;test&quot;
    },
    &quot;participants&quot;: [
      {
        &quot;_id&quot;: &quot;62d5b5b5688fec147542ae10&quot;,
        &quot;fullname&quot;: &quot;Mircea Feder&quot;,
        &quot;email&quot;: &quot;testY&quot;
      },
      {
        &quot;_id&quot;: &quot;62d5c428ca6400ec392d2be4&quot;,
        &quot;fullname&quot;: &quot;testZ&quot;,
        &quot;email&quot;: &quot;testZ&quot;
      }
    ],
    &quot;invitees&quot;: [
      {
        &quot;_id&quot;: &quot;62d5c428ca6400ec392d2be4&quot;,
        &quot;fullname&quot;: &quot;testZ&quot;,
        &quot;email&quot;: &quot;testZ&quot;
      }
    ],
    &quot;date&quot;: &quot;2012-04-23T18:25:43.511Z&quot;,
    &quot;duration&quot;: 60,
    &quot;maxPlayers&quot;: 22
  }
  </code></pre>