Node.js 将Sql查询转换为Sequelize ORM
大家好,我正在使用PostgreSql作为node.js项目的数据库,并使用Sequelize作为ORM。 我有一个查询,我想转换int Sequelize代码。 以下是查询:Node.js 将Sql查询转换为Sequelize ORM,node.js,postgresql,express,sequelize.js,pg,Node.js,Postgresql,Express,Sequelize.js,Pg,大家好,我正在使用PostgreSql作为node.js项目的数据库,并使用Sequelize作为ORM。 我有一个查询,我想转换int Sequelize代码。 以下是查询: select * from "Timeslots" tm where NOT EXISTS ( select * from "BookedSlots" b join "Days" d on b."dayId" = d.id
select * from "Timeslots" tm
where NOT EXISTS (
select * from "BookedSlots" b
join "Days" d on b."dayId" = d.id
join "Channels" ch on b."channelId" = ch.id
where b."timeslotId" = tm.id
and b."timeslotId" = 1
and b."channelId" = 1
)
如何将其转换为sequelize orm形式(我是sequelize新手)