Category : aggregation-framework

I am trying to get last purchases with item, location and batch. So I tried to get ids of each by grouping. I can’t use group command because it is huge data and can not be handle by group command. $builder = $dManager->createAggregationBuilder(‘UserPurchases’); $builder->hydrate(false); $builder->match()->field(‘isRemoved’)->equals(false) ->field(‘createdAt’)->lte($dateEndVal) ->group()->field(‘id’) ->expression( $builder->expr() ->field(‘item’) ->expression(‘$item’) ->field(‘location’) ->expression(‘$location’) ->field(‘batch’) ->expression(‘$batch’) ..

Read more