Answer the question
In order to leave comments, you need to log in
Postgres Sequlize how to filter data through linked table?
I have 2 tables with a many-to-many relationship.
post <-> category
@BelongsToMany(() => Category, () => PostCategories)
categories: Category[];
// Хочу получить посты только из категорий 2 и 3
where: {
categories: {
[Op.in]: [2, 3],
},
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question