We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of global.sequelize and of $lte operator.
global.sequelize
$lte
I use this patch (with patch-package)
diff --git a/node_modules/koa2-ratelimit/src/SequelizeStore.js b/node_modules/koa2-ratelimit/src/SequelizeStore.js index f5bceb4..ac3b23b 100644 --- a/node_modules/koa2-ratelimit/src/SequelizeStore.js +++ b/node_modules/koa2-ratelimit/src/SequelizeStore.js @@ -1,4 +1,5 @@ const Sequelize = require('sequelize'); +const Op = Sequelize.Op; const Store = require('./Store.js'); @@ -116,7 +117,7 @@ class SequelizeStore extends Store { } async _increment(table, where, nb = 1, field) { - return table.update({ [field]: global.sequelize.literal(`${field} + ${nb}`) }, { where }); + return table.update({ [field]: this.sequelize.literal(`${field} + ${nb}`) }, { where }); } // remove all if time is passed @@ -124,7 +125,7 @@ class SequelizeStore extends Store { const now = new Date(); await table.destroy({ where: { - date_end: { $lte: now.getTime() }, + date_end: { [Op.lte]: now.getTime() }, }, }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Use of
global.sequelize
and of$lte
operator.I use this patch (with patch-package)
The text was updated successfully, but these errors were encountered: