public function getListQuery()
{
$builder = $this->createQueryBuilder();
return $builder->getQuery();
}
$listQuery = $this->documentManager->getRepository(AwinProduct::class)
->getListQuery();
// Paginate the results of the query
$appointments = $paginator->paginate(
// Doctrine Query, not results
$listQuery,
// Define the page parameter
$request->query->getInt('page', 1),
// Items per page
5
);
faced with error
CommandException
Executor error during find command :: caused by :: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.
how to enable allowDiskUse: true ?
it's possible if using vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
becuase inside function for execution contain array options public function execute(array $options = [])
It looks like we don't use aggregation builder, so it's currently impossible.
If you think that current code can be improved by accepting some new configuration, feel free to propose a PR
Bug Report
when followed for last page with sorting
that's what I used for paginatin
faced with error
how to enable
allowDiskUse: true
?it's possible if using
vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
becuase inside function for execution contain array options
public function execute(array $options = [])
it's wotks like that successful
How to reproduce
with big data base, follow to last page with sort like this:
?sort=search_price&direction=desc&page=9239
Expected behavior
successful result