title: Mongo db using result of query in another query using $in
body: <p>I have the following model in mongo db:</p>
  <p>User collection</p>
  <pre><code>{
  _id:12345,
  name:&quot;Joe&quot;,
  age:15,
  }
  </code></pre>
  <p>Addresses collection</p>
  <pre><code>{
  _id:7663,
  userId:12345,
  Street:&quot;xyz&quot;,
  number:&quot;1235&quot;,
  city:&quot;New York&quot;,
  state:&quot;NY&quot;
  }
  </code></pre>
  <p>Now I want to get all the addresses of users above the age of 20. What I thought was to query all the ids of users above 20 and with the result of this query use the $in operator to find the addresses.</p>
  <p>My question is, is there a way to turn this into one query? Is there a better way to query this?
  (obs: this is just an example, with my problem I cannot embed addresses into users)</p>