Utilizing Op.match with postgres
Issue
Just looking for some pointers on how to use the Sequelize operator "match" with sequelize-typescript. I have indexes in place but when I query using [Op.match] first of all it doesn't appear to be available in any packages other than @sequelize/core ( using version ^7.0.0-alpha.10). When I change the import for Op to : import { Op } from '@sequelize/core/types';
all other operators that worked when importing through 'sequelize' no longer line up with the sequelize-typescript model definitions.
Any help/guidance is greatly appreciated!
Thanks, Jeff
Versions
- sequelize: ^6.9.0
- sequelize-typescript: ^2.1.1
- typescript: ^4.3.5
Issue type
- [ ] bug report
- [x ] feature request
Actual behavior
@sequelize/core is Sequelize 7, you need to use sequelize with Sequelize-TypeScript for now
Op.match can be used like this:
import { Op } from 'sequelize';
User.findAll({
where: { name: { [Op.match]: fn('to_tsvector', 'myString') } }
})
it will result in
"name" @@ to_tsvector('myString')