title: Cakephp aggregation query (MongoDB)
body: <p>Using <a href="https://github.com/ichikaway/cakephp-mongodb" rel="nofollow">ichikaway-cakephp</a> I am trying to convert following query (running fine in php) to cakephp </p>
  
  <p>In cakephp it returns empty array</p>
  
  <p><strong>Core PHP</strong></p>
  
  <pre><code>  $out = $collection-&gt;aggregate(array(
       array('$unwind' =&gt; '$as'),
       array(
          '$group' =&gt; array(
              '_id' =&gt; array('as'=&gt;'$as'),
             'count' =&gt; array('$sum' =&gt; 1)
          )
      )
  ));
  </code></pre>
  
  <p><strong>Cakephp</strong></p>
  
  <pre><code>$conditions=array('aggregate'=&gt;array(
                              array('$unwind' =&gt; '$as'),
                              array(
                                  '$group' =&gt; array(
                                      '_id' =&gt; array('as'=&gt;'$as'),
                                     'count' =&gt; array('$sum' =&gt; 1)
                                  )
                              )
                              ));
  
  $results = $this-&gt;Post-&gt;find('all',array('conditions'=&gt;$conditions));
  </code></pre>
  
  <hr>
  
  <h2><em><strong>I am unable to find aggrgation framework function in <a href="https://github.com/ichikaway/cakephp-mongodb/blob/cake2.2/Test/Case/Datasource/MongodbSourceTest.php" rel="nofollow">test cases</a></em></strong></h2>
  
  <p>So far <a href="https://github.com/ichikaway/cakephp-mongodb/commit/0303bac2a652062d26c804cb06e4107fd24a1595" rel="nofollow">only this</a> commit talks about aggregation. </p>