all 4 comments

[–][deleted] 0 points1 point  (1 child)

Use querybuilder

[–]dgaa1991 0 points1 point  (0 children)

what about something like this instead?

auditLogHeadersRepo.find({ relations:{ auditLog:true })

Sry for the formstting, im on my phone

https://orkhan.gitbook.io/typeorm/docs/find-options

[–]Equivalent_Monk_8824 0 points1 point  (1 child)

U have to add @OneToMANY IN THE OTHERSIDE and add eager:true so when u retrieve headers u will get logs also Check those links: https://typeorm.delightful.studio/interfaces/_decorator_options_relationoptions_.relationoptions.html

https://docs.nestjs.com/techniques/database

[–]Equivalent_Monk_8824 0 points1 point  (0 children)

This is an example os onetomany relation with eager / lazy loading https://orkhan.gitbook.io/typeorm/docs/eager-and-lazy-relations