title: Using where clause in monogdb's aggregate and pipeline
body: <p>Iam grouping a field, now I want to add where clause.<br>
  How to add where clause in following? </p>
  
  <pre><code>$query=array(
      'aggregate'=&gt;$this-&gt;table_name,
      'pipeline'=&gt; array(
          array('$group'=&gt; array('_id'=&gt; array(
                      'name'=&gt;'$name',
                      "{$field}"=&gt;'$'.$field
                  ))),
          array('$group'=&gt; array(
                  '_id'=&gt;'$_id.'.$field,
                  'count'=&gt; array('$sum'=&gt;1)
              ))
      )
  );
  $result=$mongo_db-&gt;command($query);
  </code></pre>