Attempted to call an undefined method named "allowDiskUse" of class "DoctrineODMMongoDBAggregationBuilder

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')
        )
        ->skip($skip)->limit($limit)    ;
$builder->allowDiskUse(true);
$purchase = $builder->execute();

My Expected result is

Item Name, Location, Batch, Last purchased quantity.

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *