1

Loopback default find method does not support large where condition data due to method type GET.

I am filtering list with where condition which have large array of ids. And default find method for collection not work for it. Client side i have using angularjs.

What should i do either create a POST API for find request or their are another way to handle this.

Manish Balodia
  • 1,775
  • 2
  • 17
  • 30

1 Answers1

2

As noted here, nodeJS max header size in http.request

it is not a loopback issue. Http does not define any limit, but servers usually accept 8kb or 16kb headers size and you cannot alter this on node unless you compile you own version. Making your own custom method passing your data to the body of the request will work.

itdoesntwork
  • 1,456
  • 14
  • 25
  • But this is not a good approach to make custom API for all collection. – Manish Balodia Mar 30 '18 at 09:01
  • Well obviously you cannot pass so many data to the headers. Maybe your filtering needs another approach. You could create groups and add ids there and filter by groups. The case that you need to pass so many ids to the filter probably is bad design. – itdoesntwork Mar 30 '18 at 09:15