Skip to content

document.deleteOne() does not trigger the post hook of deleteOne middleware #13624

Answered by vkarpov15
mrdulin asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately the default behavior is slightly different between updateOne and deleteOne, and we have tests that assert on this behavior. But we will change this behavior in 8.x, see #13660, specifically this test file: https://github.com/Automattic/mongoose/pull/13660/files#diff-7b7bf89c426b1b002315ff19e892ac3a7750e57ed11ad563074b4e200fad218e. Will update our docs.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mrdulin
Comment options

@vkarpov15
Comment options

Answer selected by mrdulin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants