SQL对orm查询更改进行续集
SQL查询工作正常,但在使用suquelize orm查询的节点js中不工作 SQL:很好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: {
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生成“不工作”的查询是什么?