Help with query, how to use parent value in where condition ?
Hey everyone, is there any way to pass a value from the parent, which is widgets in this example to a where condition in a left join ?
await db.query.widgets.findFirst({
where: eq(widgets.code, 'widget1'),
with: {
product: {
with: {
productFeedbacks: {
where: eq(schema.productFeedbacks.groupBrandCode, *WIDGETS.brandCode*),
}
}
},
}
});