This is necromancy :D but maybe it will help someone. I think the issue is with the "pre save" function,
it only returns the callback in one if. If you do not go inside the if a callback is never called.
return next();
At the end of the "CourseSchema.pre('save', function(next)" should fix the issue for you.
manpreet
Best Answer
2 years ago
I'm trying to save an mongoose object to db, but it doesn't work (nothing is saved, and no callback returned). The database is open, and there is a successful connection (the collection is even created according to the model, and it indexing it).
my schema: