-
-
Notifications
You must be signed in to change notification settings - Fork 610
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
When writing business logic that is something like:
processChildren(children: Child[]): Promise<void> {
await Promise.all(children.map(async child => {
const parent = await child.parent.load()
});
});
I've got an N+1 loading the parent for each child. I'd like to do something like populate: { parent } but that only works if I'm the one who loaded the children / i.e. called find.
Would it be easy/possible to add a populate method directly to EntityManager, i.e.:
em.populate(children, ["parent"]);
?
Or is there an existing/better way to do this that I'm missing?
Thanks!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request