title: How to build an Aggregation query in symfony with doctrine/mongodb?
body: <p>I'm starting out with Symfony and doctrine/mongodb. I'm trying to do an aggregation query, but I get </p>
  
  <blockquote>
    <p>Attempted to call an undefined method named "createAggregationBuilder" of class "Doctrine\ODM\MongoDB\DocumentManager"</p>
  </blockquote>
  
  <p>with something like this:</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Controller;
  
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Symfony\Component\HttpFoundation\Request;
  
  class TestController extends Controller
  {
    /**
     * @Route("/test", name="test")
     */
    public function testAction(Request $request) {
      $builder = $this-&gt;get('doctrine_mongodb')
         -&gt;getManager()
         -&gt;createAggregationQuery('AppBundle:Test');
  
      var_dump($builder);
    }
  }
  </code></pre>
  
  <p>I'm quite frustrated now, since every documentation or stackoverflow questions and answers start with</p>
  
  <pre><code>$dm-&gt;createAggregationQuery();
  </code></pre>
  
  <p>and I can't find out what <code>$dm</code> stands for in this case.</p>
  
  <p>I'd really appreciate some help here.</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I was looking around in the doctrine/mongodb-odm source code and I found that my version is missing the <code>createAggregationBuilder</code> function from both the <code>DocumentRepository.php</code> and the <code>DocumentManager.php</code> file (both located in <code>/vendor/doctrine/mongodb-odm/lib/Doctrine/MongoDB</code> folder.</p>
  
  <p>How can this be?</p>
  
  <p>I mean composer says that I have version 1.1.6, which is the latest release and on the git repo I can cleary see these methods (<a href="https://github.com/doctrine/mongodb-odm/blob/master/lib/Doctrine/ODM/MongoDB/DocumentRepository.php" rel="nofollow noreferrer">DocumentRepository.php</a>, <a href="https://github.com/doctrine/mongodb-odm/blob/315dcabc54c1a5be34ffb806b159ffd60f032827/lib/Doctrine/ODM/MongoDB/DocumentManager.php#L385" rel="nofollow noreferrer">DocumentManager.php</a>)</p>