Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 将Sql查询转换为Sequelize ORM_Node.js_Postgresql_Express_Sequelize.js_Pg - Fatal编程技术网

Node.js 将Sql查询转换为Sequelize ORM

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

大家好,我正在使用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
    join "Channels" ch on b."channelId" = ch.id
    where b."timeslotId" = tm.id
    and b."timeslotId" = 1
    and b."channelId" = 1
)
如何将其转换为sequelize orm形式(我是sequelize新手)