title: mongodb "distinct" query?
body: <p>I am not sure whether "distinct" is the right word for this.</p>
  
  <p>I have a simple messaging system in mongo with "sender","receiver","content".</p>
  
  <p>The problem I have is in the inbox page: say for example I have 3 messages from John and 4 from Jack, I would like to show in my inbox only the last message sent by each of those people.</p>
  
  <p>I have searched online and I <em>thought</em> this <a href="http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Distinct" rel="nofollow">http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Distinct</a> would be the right thing but, it doesn't seem to work or atlest I can't get it to work... meh..</p>