I have tried using the below code but i keep getting a null reply.
$user = $collection->findOne(["_id"=> "5ebb4d14ac4ad9500c235a22"]);
while( $user !==null )
{
$arr[] = array(
'template'=> $user['template'],
);
return ($arr);
}
i did some research and i think it has something to do with the id being of type object.