我有产品,并且它们与类别有关
categories: {
relation: Model.ManyToManyRelation,
modelClass: `${__dirname}/../../categories/models/category`,
join: {
from: 'products.id',
through: {
from: 'categories_products.productId',
to: 'categories_products.categoryId',
},
to: 'categories.id',
},
},
我如何构建查询以按类别ID查找产品,而没有获取类别而不是在关系表中获取产品ID,有没有办法传递whereIn({ catagories: [123, 15] })
或类似的东西?