I'm getting an error when I'm trying to execute a MongoDB query in PHP.
Parse error: syntax error, unexpected T_DOUBLE_ARROW in fiename.php on line 55
$findCount = array("$group" => (_id => "$createdby", count => ($sum:1))); //Line 55
$cursor = $collection->aggregate($findCount);
I went through most of the previously asked questions but couldn't arrive to a solution.
By the way, this is my query in MongoDB
db.collection_name.aggregate([{"$group" : {_id:"$createdby", count:{$sum:1}}} ])
Thanks