Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Replace existing document #1941

Closed
scriby opened this Issue · 3 comments

4 participants

@scriby

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.

@kiranjulapalli

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.

@vvvvalvalval

+1 I miss it badly too.

@vkarpov15
Owner

4.0 does have middleware and ability to run validators on update(). What exactly are you trying to achieve?

@vkarpov15 vkarpov15 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.