title: find first of documents for each distinct values for one field
body: <p>With a collection of documents with fields <code>field1</code>, <code>field2</code>, <code>field3</code> and so on, I need to find</p>
  
  <ol>
  <li>distinct values for <code>field3</code></li>
  <li>for each distinct value of <code>field3</code>, need to get the first document with each distinct value in <code>field3</code></li>
  </ol>
  
  <p>For # 1, I could do <code>db.myCollection.distinct("field3")</code></p>
  
  <p>How do I go about #2 ?</p>
  
  <p><strong>Sample Collection:</strong></p>
  
  <pre><code>[
      { "field1": 11, "field2": "toyota", "field3": "camry" },
      { "field1": 22, "field2": "toyota", "field3": "corolla" },
      { "field1": 33, "field2": "toyota", "field3": "camry" },
      { "field1": 44, "field2": "honda", "field3": "accord" },
      { "field1": 55, "field2": "honda", "field3": "accord" },
      { "field1": 66, "field2": "honda", "field3": "city" }
  ]
  </code></pre>
  
  <p><strong>Desired result:</strong></p>
  
  <pre><code>[
      { "field1": 11, "field2": "toyota", "field3": "camry" },
      { "field1": 22, "field2": "toyota", "field3": "corolla" },
      { "field1": 44, "field2": "honda", "field3": "accord" },
      { "field1": 66, "field2": "honda", "field3": "city" }
  ]
  </code></pre>