title: How to truncate a MongoDB collection via the DoctrineMongoDBBundle?
body: <p>I have a mongoDB collection and I want to programatically truncate it (remove all documents in this collection). I did this:</p>
  
  <pre><code>    $collection = $this
          -&gt;container
          -&gt;get('doctrine_mongodb')
          -&gt;getRepository('AppBundle:User');
  
      $document_manager = $this
          -&gt;container
          -&gt;get('doctrine_mongodb')
          -&gt;getManager();
  
      if($override){
          $document_manager-&gt;remove($collection);
  </code></pre>
  
  <p>Where <em>User</em> is the name of collection. But it does not work. How to properly remove all documents from a collection?</p>