title: SQL subquery into MongoDB
body: <p>I am basically from a SQL Server domain, now learning MongoDB. I want to convert into MongoDB native query for the following scenario. </p>
  
  <p>I have two tables <code>[Marks], [Student Details]</code>:</p>
  
  <p><strong>[Marks]</strong> table has the following structure:</p>
  
  <pre><code>StudentID Varchar(10),
  Marks Int
  </code></pre>
  
  <p><strong>[Student Details]</strong> table has following structure:</p>
  
  <pre><code>StudentID Varchar(10),
  StudentName Varchar(50),
  Age Int,
  Address Varchar(500).
  </code></pre>
  
  <p>Now I want to retrieve top 5 student who got high marks using following SQL query.</p>
  
  <pre><code>Select * From [StudentDetails] 
  where StudentID in (Select Top 5 StudentID from [Marks] order by Marks Desc)
  </code></pre>
  
  <p>I want to convert this query into MongoDB, how can I achieve this?</p>