How to get where relation has no rows

const products = await db.query.masterProducts.findMany({
  limit: pageSize,
  offset: page * pageSize,
  where: whereFilter
});

The masterProducts table has a one to many relationship with unitCosts (one master product has many unit costs). How do I modify whereFilter if I want to only fetch masterProducts rows that have no associated unitCosts?
Was this page helpful?