title: Doctrine ODM Query Builder - Find where collection is empty
body: <p>I am trying to create a query, using the doctrine ODM query builder, where a referenced association (<code>eventListeners</code>) <strong>is not empty</strong> - or the collection has one or more item.</p>
  
  <p>The query:</p>
  
  <pre><code>$qb = $om-&gt;createQueryBuilder(FormService::ENTITY_CLASS_NAME_FORM);
  $query = $qb-&gt;field('website.$id')-&gt;equals(new \MongoId($website-&gt;getId()))
              -&gt;field('status.name')-&gt;equals(FormService::STATUS_PUBLISHED)
              -&gt;field('eventListeners')-&gt;notEqual(array());
              -&gt;getQuery();
  $results = $query-&gt;execute();
  </code></pre>
  
  <p>I've been creative in my attempts with the API; This line is clearly incorrect as it still returns all the documents regardless</p>
  
  <pre><code>-&gt;field('eventListeners')-&gt;notEqual(array());
  </code></pre>
  
  <p>I can see in <a href="http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/query-builder-api.html" rel="nofollow">the documentation</a> you can use <code>field('eventListeners')-&gt;size(3);</code> however I do not know in advance what the collection size should be.</p>
  
  <p><strong>How do you query for non empty collections using Doctrine ODM?</strong> </p>