6

I've been using feathers a lot and love it, but I need to return over 1000 records for a special case. However, no matter what I do, Feathers returns a query resetting $limit to 1000, and only returns 1000 records.

I know it's getting my $limit conveyed, because if I set the limit to 1, 10, 500 or 999 it respects it, but if I set it to 1001 or anything higher, it only returns 1000.

I'm using feathers with MySQL and feathers-sequalize.

Nick Steele
  • 7,419
  • 4
  • 36
  • 33

1 Answers1

8

For anyone else having this problem, one of the creators of Feathers directed me here, which fixed the issue:

https://docs.feathersjs.com/api/databases/common.html#pagination

By default, Feathers limits service queries to 1000, even if you specify a $limit in your query afterwards.

To bypass this, just see the above doc which explains this: When creating the service, pass in a pagination object into your service options to set a default $limit to something other than 1000.

Nick Steele
  • 7,419
  • 4
  • 36
  • 33
  • 1
    Saved my day. I had an issue that if results exceeded 1000 I got only an empty array and could not understand the cause for some time. – Ricardas Oct 19 '22 at 05:55
  • Thanks, your appreciation powers my drive to help! :) I can run for another week now at least! – Nick Steele Oct 20 '22 at 03:30