I had to import operator characters from sequelize and use it like that.
const { Op } = require('sequelize') model.findAll({ where: { start_datetime: { [Op.gte]: moment().subtract(7, 'days').toDate() } } })
According to the documents, for security reasons this is considered best practice.
See http://docs.sequelizejs.com/manual/tutorial/querying.html for more information.
Using Sequelize without aliases improves security. Some frameworks automatically analyze user input in js objects, and if you are unable to sanitize the input, you can probably enter the object using string operators for Sequelize.
(...)
For greater security, it is strongly recommended that you use Sequelize.Op and not depend on any string alias. You can limit the alias your application will need by setting the operatorAliases option, remember to sanitize user input, especially when you pass them directly to Sequelize methods.
source share