sequelize/sequelize · error · Error
String based operators have been removed. Please use Symbol
Error message
String based operators have been removed. Please use Symbol operators, read more at https://sequelize.org/docs/v7/core-concepts/model-querying-basics/#deprecated-operator-aliases
What it means
String-based operator aliases (e.g. $gt, $like) and the operatorsAliases option were removed in Sequelize v7. Operators must be Symbol members of the Op object (Op.gt, Op.like, etc.).
Source
Thrown at packages/core/src/sequelize-typescript.ts:461
}
// @ts-expect-error -- sanity check
if (options.pool === false) {
throw new Error(
'Setting the "pool" option to "false" is not supported since Sequelize 4. To disable the pool, set the "pool"."max" option to 1.',
);
}
// @ts-expect-error -- sanity check
if (options.logging === true) {
throw new Error(
'The "logging" option must be set to a function or false, not true. If you want to log all queries, set it to `console.log`.',
);
}
// @ts-expect-error -- sanity check
if (options.operatorsAliases) {
throw new Error(
'String based operators have been removed. Please use Symbol operators, read more at https://sequelize.org/docs/v7/core-concepts/model-querying-basics/#deprecated-operator-aliases',
);
}
if ('dialectModulePath' in options) {
throw new Error(
'The "dialectModulePath" option has been removed, as it is not compatible with bundlers. Please refer to the documentation of your dialect at https://sequelize.org to learn about the alternative.',
);
}
if ('dialectModule' in options) {
throw new Error(
'The "dialectModule" option has been replaced with an equivalent option specific to your dialect. Please refer to the documentation of your dialect at https://sequelize.org to learn about the alternative.',
);
}
if ('typeValidation' in options) {
throw new Error(View on GitHub (pinned to 7e1deec499)
Solutions
- Remove the operatorsAliases option entirely.
- Replace string operators with Op.* symbols: { age: { [Op.gt]: 18 } }.
Example fix
// before
new Sequelize({ operatorsAliases: { $gt: Op.gt } });
User.findAll({ where: { age: { $gt: 18 } } });
// after
import { Op } from '@sequelize/core';
User.findAll({ where: { age: { [Op.gt]: 18 } } }); Defensive patterns
Strategy: validation
Prevention
- Always use Op.* symbol operators.
- Codemod $-prefixed operators during upgrade.
When it happens
Trigger: Passing the operatorsAliases option, or using string operators in where clauses like { age: { $gt: 18 } }.
Common situations: v5/v6 query code; tutorials using $-prefixed operators.
Related errors
- Accessing the connection manager is unlikely to be necessary
- Sequelize#modelManager was removed. Use Sequelize#models ins
- The Sequelize constructor no longer accepts multiple argumen
- The Sequelize constructor no longer accepts a string as the
- Support for `{ where: 'raw query' }` has been removed. Use `
AI-assisted analysis of sequelize/sequelize@7e1deec499 (2026-08-03).
Data as JSON: /data/errors/d8256227170251f4.json.
Report an issue: GitHub.