Sequelize string deprecation warning
1 min read

Sequelize string deprecation warning

Sequelize was giving me the following error even without any string based operators.

sequelize deprecated String based operators are now deprecated. 
Please use Symbol based operators for better security, read more at node_modules/sequelize/lib/sequelize.js:236:13

The warning is displayed if you don’t set operatorsAliases, and it absolutely should be displayed if operatorsAliases is not set to some mapping or is set to false.
You can set operatorAliases to false or import Sequelize OP into the Sequelize instantiation.

const Op = Sequelize.Op;
const sequelize = new Sequelize('test', 'test', 'pass1234', {
  host: '',
  dialect: 'mysql',
  operatorsAliases: Op, // use Sequelize.Op
  pool: {
    max: 5,
    min: 0,
    idle: 10000