-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Add model
, deleteModel
events to connection
#9983
Labels
new feature
This change adds new functionality, like a new method or class
Milestone
Comments
vkarpov15
added
the
new feature
This change adds new functionality, like a new method or class
label
Mar 1, 2021
vkarpov15
added a commit
that referenced
this issue
Mar 4, 2021
…ections when creating and deleting models Fix #9983
This was referenced Mar 11, 2021
Closed
This was referenced Mar 13, 2021
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Right now there is no way for a plugin to be notified if a model is deleted. The 'init' event on schemas can tell you when a model is init-ed, but that is counterintuitive.
What is the expected behavior?
conn.on('model', model => console.log('Created model ' + model.modelName));
conn.on('deleteModel', model => console.log('Deleted model ' + model.modelName));
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Mongoose 5.11.x. Node.js and MongoDB versions don't matter for this issue.
The text was updated successfully, but these errors were encountered: