-1
SQL查詢工作正常,但在節點js中使用suquelize orm查詢不起作用。SQL將序列化ORM查詢更改
SQL:沃金精
select message from tbl_chat where (userId=1 or userId=98) and (receiverId=1 or receiverId=98) and isgroupChat=0;
Sequelize ORM:不工作
let result = await Chat.findAll<Chat>({
where: {
isgroupChat: 0,
$and: {
$or: [
{
userId: userId
},
{
userId: userId
}
],
$or: [
{
receiverId: receiverId
},
{
receiverId: receiverId
}
]
}
}
});
什麼查詢是orm生成的 – Shivam
「Not working」_how?_ –