Thomas
Thomas
DTDrizzle Team
Created by Thomas on 10/19/2023 in #help
How to filter by a column in a related table?
Thanks, but inner join doesn't seem to support including the ingredients in the response. Got it working like this:
const all = await db.query.recipes.findMany({
where: like(products.display, '%cheese%'),
with: {
ingredients: {
with: {
product: true,
},
},
},
})
const all = await db.query.recipes.findMany({
where: like(products.display, '%cheese%'),
with: {
ingredients: {
with: {
product: true,
},
},
},
})
5 replies