title: Getting the most recent record for each unique user in Parse using PFQuery
body: <p>I'm using Parse.com, and have two classes: <code>User</code> and <code>Report</code>. A <code>User</code> may issue several reports during a day, but I'm only interested in the most recent one. However, I need to get all the reports that meet specific criteria, but only the most recent one.</p>
  
  <p>The end result is an array of <code>Report</code>s, where the <code>User</code> is unique on each one, something like this:</p>
  
  <pre><code>ObjectId | ReportedValue | User | CreatedAt
  1234     | 100           | aaaa | 2013-05-20T04:23:41.907Z
  1235     | 100           | bbbb | 2013-04-29T05:10:41.907Z
  1236     | 100           | cccc | 2013-05-20T02:14:41.907Z
  1237     | 100           | dddd | 2013-05-19T04:03:41.907Z
  </code></pre>
  
  <p>So, <code>User</code> aaaa might have 20 reports, but I only need the most recent, for each user. However, I'm searching based on the <code>ReportedValue</code> being <code>100</code>, and the desired result is the report objects, not the user, so I'd prefer not to go through every user.</p>
  
  <p>Is this possible in Parse?</p>