Skip to content
New issue

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

deleteOne and deleteMany middleware #7195

Closed
skoope opened this issue Oct 29, 2018 · 3 comments
Closed

deleteOne and deleteMany middleware #7195

skoope opened this issue Oct 29, 2018 · 3 comments
Labels
new feature This change adds new functionality, like a new method or class
Milestone

Comments

@skoope
Copy link

skoope commented Oct 29, 2018

In latest Mongoose version (v5.3.7) the "remove()" method is deprecated in favor of deleteOne() and deleteMany(), but in the documention there is no replacement of the pre('remove') middleware that triggers when using deleteOne() or deleteMany().

Node.js : v8.12.0
MongoDB : v3.6.8
Mongoose : 5.3.7

Thanks in advance.

@vkarpov15
Copy link
Collaborator

Looks like we don't have pre('deleteOne') and pre('deleteMany') hooks yet. We will add those for our next minor release.

@vkarpov15 vkarpov15 added this to the 5.4 milestone Nov 2, 2018
@vkarpov15 vkarpov15 added the new feature This change adds new functionality, like a new method or class label Nov 2, 2018
@vkarpov15 vkarpov15 changed the title Equivalent of pre('remove') middleware with Mongoose 5.3.7 deleteOne and deleteMany middleware Nov 2, 2018
@skoope
Copy link
Author

skoope commented Nov 5, 2018

Thank you for your response. I Will handle the delete manually till the next release ! thanks again.

@vkarpov15
Copy link
Collaborator

Keep an eye out for Mongoose 5.4, ETA mid December 👍 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This change adds new functionality, like a new method or class
Projects
None yet
Development

No branches or pull requests

3 participants