Hy
I am trying to add a subdocument to an array of documents. I have a collection with the following structure:
id name comments [ {name: fool, comment: fool}, {name: foolTwo, comment: foolTwo} ]
When I try to add another subdocument it replaces the existing one. In pure code I would like this:
$ collection-> update ( array ('_id' => new Mongoid ($ id)), array ('$ push' => array ("comments" => array ("name" => $ name, 'comment' => $ text,))));
How do I do this in the Phalcon?
Thank you for attention.