sequelize-typescript
sequelize-typescript copied to clipboard
Op.not operator shows a warning
Issue
Using Op.not operator in any of the queries, Eg: findAll, findOne.. shows a warning in my code editor (VS Code). But the code compiles and runs without any error.
where: {
[Op.not]: true
}
Error:
Type '{ [Op.not]: true; }' is not assignable to type 'WhereOptions<any>'.
Types of property '[Op.not]' are incompatible.
Type 'true' is not assignable to type 'undefined'.ts(2322)
model.d.ts(850, 3): The expected type comes from property 'where' which is declared here on type 'UpdateOptions<any>'
Versions
- sequelize: 6.6.5
- sequelize-typescript: 2.1.0
- typescript: 4.2.3
Issue type
- [x] bug report
- [ ] feature request
Actual behavior
Expected behavior
Steps to reproduce
Related code
It's most likely issue of sequelize types rather than sequelize-typescript as it doesn't modify these types, just extends couple of model related ones. Would recommend opening issue in sequelize repo if not already opened.
It's most likely issue of sequelize types rather than sequelize-typescript as it doesn't modify these types, just extends couple of model related ones. Would recommend opening issue in sequelize repo if not already opened.
Okay, thank you
We have recently fixed this in Sequelize 7, but it hasn't been backported to Sequelize 6 yet https://github.com/sequelize/sequelize/pull/14022