You will need to reformat, and also use commas as separators. This is a pipeline, so it takes each element at a time.
I have not tried this, but I will try:
array ( array( array( '$project' => array( "group_name" => 1, "group_id" => 1, ) ), array( '$group' => array( "_id" => array("group_name" => '$group_name'), "total_sum" => array('$sum' => 1), ), ) )
Ricky hartmann
source share