1

I am evaluating loopback as the API server for a new project. I need to return data in a format specific to Ember and I need to return either: an array of IDs to related models, or an embedded array of the related models objects.

I have experimented with using the Include filter to automatically include the related models (using hasMany relationship type). When we do basic performance testing we find that the include filter adds a significant performance penalty.

What is the best performing method for getting access to the related models?

Mark Lummus
  • 740
  • 8
  • 17

1 Answers1

0

Assume that we have category that hasMany products.

To get products, related to category, request the /api/category/:id/products endpoint.

Also you can use limit and fields filter for better performance.

IvanZh
  • 2,265
  • 1
  • 18
  • 26