title: Filter realm objects based on counting list<t>
body: <p>I'm trying to query a class based on the number of match objects. However, I keep getting following error <code>'Unable to parse the format string "matches.@count &gt; 0"'</code>. I've tried following code from the documentation, but it does not help. What I want is to get all leagues, which has more than 0 matches?</p>
  
  <p><strong>Class</strong></p>
  
  <pre><code>class League:Object {
      dynamic var id: Int = 0
      dynamic var name: String? = ""
      var matches = List&lt;Match&gt;()
  
  
      override class func primaryKey() -&gt; String {
          return "id"
      }
  }
  
  class Match:Object {
      dynamic var matchId: Int = 0
      dynamic var date: NSDate = NSDate()
      dynamic var homeName: String? = ""
      dynamic var awayName: String? = ""
      dynamic var homeAcro: String? = ""
      dynamic var awayAcro: String? = ""
      dynamic var awayScore: Int = 0
      dynamic var homeScore: Int = 0
      dynamic var leagueName: String? = ""
      dynamic var homeLogo: NSData = NSData()
      dynamic var awayLogo: NSData = NSData()
  
      override class func primaryKey() -&gt; String {
          return "matchId"
      }
  
  }
  </code></pre>
  
  <p><strong>Tried code</strong></p>
  
  <pre><code>let realm = try! Realm()
  let predicate = NSPredicate(format: "matches.@count &gt; 0")
  menuArray = realm.objects(League).sorted("id").filter(predicate)
  </code></pre>