我最近升级了项目中的许多软件包,由于这样做,因此以下查询现在失败:
query['where'] = { [Op.and]: [
sequelize.where(Database.getInstance().getConnection().col('id'), '!=', jsonObject['id'] ),
sequelize.where(Database.getInstance().getConnection().col('username'), jsonObject['username'])
]};
console.log('Check if username is unique...');
console.log(query);
结果为:
Unhandled rejection Error: Invalid value Where {
attribute: Col { col: 'id' },
comparator: '=',
logic: { [Symbol(not)]: 1563 } }
attribute: Col { col: 'id' },
我也尝试过:
query['where'] = { [Op.and]: [
sequelize.where(Database.getInstance().getConnection().col('id'), '!=', jsonObject['id'] ),
sequelize.where(Database.getInstance().getConnection().col('username'), jsonObject['username'])
]};
While following the docs,但仍然导致错误:
Unhandled rejection Error: Invalid value Where { attribute: Col { col: 'id' }, comparator: '!=', logic: 1563 }