title: Swift NSPredicate SUBQUERY with NOT IN?
body: <p>Is it possible to use "NOT IN" in a NSPredicate with a SUBQUERY?</p>
  
  <p>In a 'normal' NSPredicate, this works: </p>
  
  <pre><code>NSPredicate(format: "NOT (uid IN %@)", uids)
  </code></pre>
  
  <p>However, I'm trying this "NOT IN" syntax in a NSPredicate with SUBQUERY and it doesn't work (but doesn't crash either):</p>
  
  <pre><code>NSPredicate(format:"SUBQUERY(forests.treeFamily, $tree, NOT ($tree._id IN %@)) .@count &gt; 0", arrayOfTreesIds)
  </code></pre>
  
  <p>While the following "IN" syntax works fine:</p>
  
  <pre><code>NSPredicate(format:"SUBQUERY(forests.treeFamily, $tree, $tree._id IN %@) .@count &gt; 0", arrayOfTreesIds)
  </code></pre>
  
  <p>Any idea how I could achieve this?</p>
  
  <hr>
  
  <p><strong>UPDATED</strong></p>
  
  <p>The answer I got from Jay made me think I wasn't clear enough on the schema/class.</p>
  
  <p>So let's make an example with dogs.</p>
  
  <p>We have a ShelterClass, that has a property of Dogs. It's an array of Dog objects, to keep tracks of which dogs are hosted in the shelter.</p>
  
  <p>The Dog class has a "race" property, which is a reference to a Race class.</p>
  
  <p>I want to filter Shelters that DON'T have certain races of dogs.
  While I would use this to filter Shelters that DO have certain races of dogs:</p>
  
  <pre><code>NSPredicate(format:"SUBQUERY(dogs.race, $race, $race._id IN %@) .@count &gt; 0", arrayOfRaceIds)
  </code></pre>
  
  <p>I can't find how to filter out / use a "NOT IN" syntax.</p>