title: How to implement nested query via Java code for mongoDB
body: <pre><code>db.a.find({ "id" : { "$in" : db.b.distinct("id") } })
  </code></pre>
  
  <p>This nested query is workable via shell client.</p>
  
  <p>I'd like to implement it via Java code, but I don't know how.
  Could anyone please help me?</p>