I am trying to replace $ref in Mongo with actual objects. I am using doctrine-odm bundle and Symfony as framework.
Above you can see the attributeSet property being a $ref instead of the object it self.
$query = $this->createAggregationBuilder();
$query->match()->field('id')->equals($id);
$query
->lookup('AttributeSet')
->localField('attributeSet._id')
->foreignField('_id')
->alias('attributeSet');
return $query
->getAggregation()
->getIterator();
My code above is not working and i can not figure out why ( below is output of the code ).

