I have two entities: Something and Other (prototypes are below).
How can I use In() method to find all Somethings that have related Others by array of Others ids?
I need something like this:
const smths: Array<Something> = await connection.getRepository(Something).find({
others: In(arrayWithOthersIds),
});
Entities:
@Entity()
class Something {
@PrimaryGeneratedColumn('uuid')
id: string;
@ManyToMany(() => Other, (other) => other.smths, { cascade: true })
others: Other[];
}
@Entity()
class Other {
@PrimaryGeneratedColumn('uuid')
id: string;
@ManyToMany(() => Something, (smth) => smth.others, { cascade: true })
smths: Something[];
}