php - How can I print all values in group option? -
i couldn't find. i've read , done of these: http://docs.mongodb.org/manual/reference/aggregation/ , these: http://php.net/manual/en/mongocollection.aggregate.php
but couldn't make happen. i'm trying learn, complicated. mongodb complicated.
this code:
$hg = $collection_iddaa->aggregate(array( array('$project'=> array( 'lig_adi'=>1, 'ulke_adi'=>1, 'ulke_kisa'=>1, 'hometeam'=>1, 'awayteam'=>1, 'homegol'=>1, 'awaygol'=>1, 'baslangic'=>1, 'status'=>1, 'ptime'=>1 ) ), array( '$group' => array( '_id' => array('lig_adi'=>'$lig_adi', 'ulke_adi'=>'$ulke_adi'), "ulke_kisa" => array('$addtoset' => '$ulke_kisa'), "hometeam" => array('$addtoset' => '$hometeam'), "awayteam" => array('$addtoset' => '$awayteam'), 'homegol'=>array('$addtoset' => '$homegol'), 'awaygol'=>array('$addtoset' => '$awaygol'), 'baslangic'=>array('$addtoset' => '$baslangic'), 'status'=>array('$addtoset' => '$status'), 'ptime'=>array('$addtoset' => '$ptime') )) ));
when use $addtoset
option, returning unique value , doesn't show repeats. want show values, not unques. should do? how can show values after use group option.
i want show "ulke_kisa" "hometeam" "awayteam" "homegol" bla bla bla, after using group.
Comments
Post a Comment