title: Doctrine and Mongodb: Remove all documents with field not in array
body: <p>I want to remove all documents with a field not in an array of ids that I have. When I try, it just removes everything from my database.</p>
  
  <p>This is the code I have:</p>
  
  <pre><code>public function removeNotInListingIdList($ids, $country) {
        $dm = $this-&gt;getDocumentManager();
        $dm-&gt;createQueryBuilder('DnDReactivePandoraBundle:Property')
          -&gt;remove()
          -&gt;field('listingId')-&gt;notIn($ids)
          -&gt;field('country', $country)
          -&gt;getQuery()
          -&gt;execute();
    }
  </code></pre>
  
  <p>What I'm I doing wrong here?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>This is the output of the <em>debug</em> instruction:</p>
  
  <pre><code>Array
  (
      [type] =&gt; 3
      [query] =&gt; Array
          (
              [listingId] =&gt; Array
                  (
                      [$nin] =&gt; Array
                          (
                              [0] =&gt; 15-77
                              [1] =&gt; 15-79
                              [2] =&gt; 15-82
                              [3] =&gt; 13-39
                              [4] =&gt; 15-85
                              [5] =&gt; 15-86
                              [6] =&gt; 15-60
                              [7] =&gt; 15-61
                              [8] =&gt; 16-8
                          )
  
                  )
  
              [country] =&gt; Mexico
          )
  
      [newObj] =&gt; Array
          (
          )
  
  )
  </code></pre>