pre save middleware in mongoose
问题 i am first time using pre save middleware and getting a bit confusion in it. It runs perfectly fine and also my save method is getting executed eventhough i am not calling the next() case 1 tourSchema.pre('save', function () { console.log('first middleware is getting called'); }) But when i do like this when next is declared inside the function params but i don't call the next() it hangs there and the save method is not getting executed case 2 tourSchema.pre('save', function (next) { console