如何使用$和sequelize PostgreSQL

问题描述 投票:0回答:1

这是我的代码:

let result = await models.trans.findAll({
            where: {
                $and: [{
                    type: 'JSON'
                },{
                    type: 'BSON' 
                }],
                language: 'English
            }
        });

我想根据类型获取数据,如何为同一列传递2个值? json和bson类型的数据都应该返回

postgresql sequelize.js where-clause
1个回答
0
投票

你用错了算子。只需将$and更改为$or

© www.soinside.com 2019 - 2024. All rights reserved.