I have a SQL query like :
delete from myTable where versionId in (select id from version where code='TEST')
A select query nested inside a delete query. I would like to build the same query using NodeJS Sequelize, so the code could be something like this :
db.myTable.destroy({
where: {
versionId: { $in: [12, 34, 56] }
}
}).then(nbDeleted => {
...
}
In that example, [12, 34, 56] is hard coded, but instead of it, I would like to use the select query.
I tried to googled in that way, but for now I'm not able to find the solution.
Any ideas ?