Created
March 12, 2016 11:24
-
-
Save aherve/dbf2bb4088219fe4720f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import postCreate from '/wathever/postCreate.js' | |
| //... Your schema definition as usual | |
| // declare the plugin for your model | |
| mySchema.plugin(postCreate) | |
| // anywhere else: | |
| mySchema.addPostCreate(function (user, cb) { | |
| // this will only be executed ad the user creation | |
| console.log('a new user has been created !') | |
| return cb(null) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment