Reputation: 973
I need to return relational data with limited rows, I have seen solutions using query builder how can we achieve the same thing using standard typeorm events?
return await Product.find({ relations: ['productSizes', 'productColors'] });
Upvotes: 2
Views: 1455
Reputation: 2997
to make the limit for your product entity, you only need to add take:numberTolimit
return await Product.find({ relations: ['productSizes', 'productColors'],take:10 });
Ps : you can use skip
- offset from where entities should be taken.
Upvotes: 2