Adonis Query Builder: How to make .where condition on relationship

Viewed 1809

So I have this query

return await Order
      .query()
      .with('order_status')
      .where('order_status.is_completed_type', true)

I want to only get the orders with order_status.is_completed_type === true

but it seems that doesn't work that way, is there a way to do this?

1 Answers
Related