正确使用Opqual和Op.or的正确方法?

时间:2020-05-20 03:25:48

标签: node.js postgresql sequelize.js

你好,我是sequalizer的新手,我陷入查询中,我需要将以下查询转换为sequalizer Op.and和Op.or格式

查询:

select * from "productSpecifications" where ("specificationId"='773' and value='A' OR value = 'B') AND ("specificationId"='774' and value='B');

我正在尝试按照以下步骤进行创建,但这是行不通的:

Op.and: [
    Op.and: [
        "specificationId" : 773,
        Op.or:[
            {value: 'A'},
            {value: 'B'}   
        ]
    ],
    Op.and: [
        "specificationId" : 774,
        Op.or:[
            {value: 'A'}   
        ]
    ],
]

有人知道这个查询出了什么问题吗?

0 个答案:

没有答案