'Get big data from API through POSTMAN, got error: <Sort exceeded memory limit of 104857600 bytes>

Error: Sort exceeded memory limit of 104857600 bytes, but did not opt in to external sorting. Aborting operation. Pass allowDiskUse:true to opt in.

This is my query body:

{
    "tbProjectId":"******",
    "pageSize": 5000,
    "pageToken": "*****",
    "allowDiskUse": true
}

pageToken is used to switch to next page because the max records for single page is 5000.

It seems I can only get data from the first 3 pages, When I try to query the 4th page, I got this error above.

I tried to added "allowDiskUse" to query body but it doesn't work, what should I do to get 36,000 records?



Solution 1:[1]

Are you querying MongoDB? The definition should include the following:

@ApiResource(attributes={
    "doctrine_mongodb"={
      "execute_options"={
        "allowDiskUse"=true
      }
    }
})

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vladimir Ryabtsev