title: mongoDB distinct return multiple attributes
body: <p>Is there a way to combine distinct with another command to print not only the distinct attributes but also an attribute linked to the distinct one?</p>
  
  <p>For example, print only 0,foo and 1,bar from the table below.</p>
  
  <pre><code>-----------------
  |  id  |  name  |
  |  0   |  foo   |
  |  1   |  bar   |
  |  1   |  bar   |
  </code></pre>
  
  <p>I am currently using</p>
  
  <pre><code>&gt;db.foo.distinct('id')
  </code></pre>
  
  <p>to return ids on a db and what to use that to print the mathcing names.</p>