Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.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
SQL对orm查询更改进行续集_Sql_Sequelize.js - Fatal编程技术网

SQL对orm查询更改进行续集

SQL对orm查询更改进行续集,sql,sequelize.js,Sql,Sequelize.js,SQL查询工作正常,但在使用suquelize orm查询的节点js中不工作 SQL:很好 select message from tbl_chat where (userId=1 or userId=98) and (receiverId=1 or receiverId=98) and isgroupChat=0; 续集:不工作 let result = await Chat.findAll<Chat>({ where: {

SQL查询工作正常,但在使用suquelize orm查询的节点js中不工作

SQL:很好

select message from tbl_chat where (userId=1 or userId=98) and (receiverId=1 or receiverId=98) and isgroupChat=0;
续集:不工作

             let result = await Chat.findAll<Chat>({

            where: {
                isgroupChat: 0,
                $and: {
                    $or: [
                        {
                            userId: userId
                        },
                        {
                            userId: userId
                        }
                    ],
                    $or: [
                        {
                            receiverId: receiverId
                        },
                        {
                            receiverId: receiverId
                        }
                    ]
                }
            }
        });
let result=wait Chat.findAll({
其中:{
iGroupChat:0,
美元及:{
$or:[
{
userId:userId
},
{
userId:userId
}
],
$or:[
{
收款人:收款人
},
{
收款人:收款人
}
]
}
}
});

不确定这到底为什么不起作用。打开日志记录并查看ORM为查询生成的内容。但是,我也会尝试稍微更改查询:

 {
   where: {
     isGroupChat: 0,
     userId: { $in: [uid1, uid2] },
     receiverId: { $in: [uid1, uid2] }
 }

orm生成“不工作”的查询是什么?