I've been looking for a way to take a model instance and completely overwrite an existing entry in Mongo with it. I'd like validation and other middleware to run on the instance being saved.
The overwrite functionality added in 3.8 looks close to what I want, but it appears that it doesn't run validation and middleware.
Yes, I am also looking for the exact same feature. My schema have mixed sub documents and when I try to save, it only updates the changes but doesn't delete the others. In some cases, I want them to be deleted.
+1 I miss it badly too.
4.0 does have middleware and ability to run validators on update(). What exactly are you trying to achieve?