title: How to filter entities by many relationship count using SUBQUERY in Core Data
body: <p>I would like to get a list of cities that have location with more than 3 checkins.</p>
  
  <p>city -> locations -> checkins</p>
  
  <p>It seems I tried every possible subquery and I keep getting obscure errors. Would really appreciate some help.</p>
  
  <p><code>"SUBQUERY(locations, $l, $l.checkins.@count &gt; 3).@count != 0"</code></p>
  
  <blockquote>
    <p>'Keypath containing KVC aggregate where there shouldn't be one; failed to handle $l.checkins.@count'</p>
  </blockquote>