diff --git a/packages/strapi-mongoose/lib/index.js b/packages/strapi-mongoose/lib/index.js index 2480d269b6..0fd28bc28e 100755 --- a/packages/strapi-mongoose/lib/index.js +++ b/packages/strapi-mongoose/lib/index.js @@ -144,6 +144,8 @@ module.exports = function (strapi) { save: 'afterSave' }; + // Mongoose doesn't allow post 'remove' event on model. + // See https://github.com/Automattic/mongoose/issues/3054 _.forEach(postLifecycle, (fn, key) => { if (_.isFunction(target[model.toLowerCase()][fn])) { collection.schema.post(key, function (doc, next) { diff --git a/packages/strapi-mongoose/package.json b/packages/strapi-mongoose/package.json index be4b7a77e6..7ae108c900 100755 --- a/packages/strapi-mongoose/package.json +++ b/packages/strapi-mongoose/package.json @@ -16,7 +16,7 @@ "main": "./lib", "dependencies": { "lodash": "^4.17.4", - "mongoose": "^5.0.4", + "mongoose": "^5.0.15", "mongoose-float": "^1.0.2", "pluralize": "^6.0.0", "strapi-utils": "3.0.0-alpha.12" @@ -48,4 +48,4 @@ "npm": ">= 5.3.0" }, "license": "MIT" -} \ No newline at end of file +}