title: how to limit the count of every single array elements in find using $in function in mongodb?
body: <p>Below is my variable.</p>
  
  <pre><code>var list = [sun,moon,earth,wind,air];
  
  db.nature.find({"name":{"$in":list}}).limit(2)
  </code></pre>
  
  <p>The thing is each element in the list array contains more than 5 search results..</p>
  
  <p>For example:
          the keyword 'sun' has 5 search results,
          the keyword 'moon' has 5 search results
          the keyword 'earth' has 5 search results
          the keyword 'wind' has 5 search results
          the keyword 'air' has 5 search results...
  i need to limit each search results by 2..(i.e)i need to have the first two search list of every element in the list array.what can be done?
  The wind element in the list contains the search result as below.</p>
  
  <pre><code> {
   "_id": "59229b31a8de7a8323c1e92a",
          "name": "wind",
          "class":"1"
          }
          {
   "_id": "59229b31a8de7a8323c1e93a",
          "name": "wind",
          "class":"2"
          }
          {
   "_id": "59229b31a8de7a8323c1e94a",
          "name": "wind",
          "class":"3"
          }
          {
   "_id": "59229b31a8de7a8323c1e95a",
          "name": "wind",
          "class":"4"
          }
          {
   "_id": "59229b31a8de7a8323c1e62a",
          "name": "wind",
          "class":"5"
          }
  </code></pre>
  
  <p>But what i need is i need only the first two search result of every each element likewise..</p>