Fixing a very common warning of Sequelize.js

12 February 2019

1 min read

We had this constant error showing up in our development logs :

squelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules/sequelize/lib/sequelize.js:236:13

On simple google search, lead me to this huge issue on GitHub https://github.com/sequelize/sequelize/issues/8417.

Conversation over there is huge, there seems to be many potentials solutions, the ones which collaborators most suggested was to disable operator aliasing. So any string based operator will be disabled without any aliases instead symbol based built in operators will be used. This prevents cross site attacks.

1const sequelize = new Sequelize(config.databaseUrl, {
2  operatorsAliases: false,
3});

Follow here for even in detail explanation.