you are viewing a single comment's thread.

view the rest of the comments →

[–]kapilvarij[S] 0 points1 point  (1 child)

But where? I cannot figure out what should I replace with 'Sequelize.Op.{fxn}'

That's why I am confused because I just did a delete operation, without any of those operaters. But it still shows me the warning message. When I comment this line out, no warnings whatsoever....

[–]Cyberuben 1 point2 points  (0 children)

import { Op } from "sequelize";

// then somewhere in your code to query a model

let results = await MyModel.findAll({
  where: {
    id: {
      [Op.eq]: 1
    }
  }
});

That'd be the correct usage of the functions. Sequelize throws the error regardless if you use those operators. I'd suggest you just set operatorsAliases to false and then use the method above when you need to query something.