title: Doctrine ODM - Clear / update / remove EmbedDocument relations
body: <p>I'm experiencing a problem with Doctrine ODM. When I create an entity with a simple EmbedMany relationship to another document (i.e. a nickpage with many comments as embedded documents), and I try to clear the collection, the collection still exists with all elements:</p>
  
  <pre><code>/** @Document */
  class Nickpage
  {
     ...
  
     /** @EmbedMany(targetDocument="Comment") */
     protected $comments = array();
  
     ...
  
     public function clearComments()
     {
        $this-&gt;comments = array();
        // or:
        // $this-&gt;comments = new \Doctrine\Common\Collections\ArrayCollection();
        return $this;
     }
  }
  </code></pre>
  
  <p>When I simply load a nickpage with the associated comments, and I call</p>
  
  <pre><code>$nickpage-&gt;clearComments();
  $dm-&gt;persist($nickpage);
  $dm-&gt;flush();
  </code></pre>
  
  <p>the comments still exist. The same phenomenon occurs when I delete some elements in the ArrayCollection $comments and I flush...</p>
  
  <p>Am I on the wrong way with handling such relationships (i.e. use ReferenceMany) or is it the wrong way to work with the references?</p>
  
  <p>Greetz from Germany,
  Andi</p>