diff --git a/reference/mongo/mongocollection/aggregate.xml b/reference/mongo/mongocollection/aggregate.xml index 17be842531..ede89355b7 100644 --- a/reference/mongo/mongocollection/aggregate.xml +++ b/reference/mongo/mongocollection/aggregate.xml @@ -75,6 +75,7 @@ selectDB("examples")->selectCollection("article"); $c->drop(); @@ -110,13 +111,14 @@ $ops = array( array('$unwind' => '$tags'), array( '$group' => array( - "_id" => array("tags" => 1), + "_id" => array("tags" => '$tags'), "authors" => array('$addToSet' => '$author'), ), ), ); $results = $c->aggregate($ops); var_dump($results); +?> ]]> &example.outputs;