Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: make model.prototype.deleteOne() return query, not promise #13660

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

vkarpov15
Copy link
Collaborator

Fix #13369

Summary

Requires a little extra work beyond what Document.prototype.updateOne() does, because:

  1. deleteOne() should not actually send deleteOne to the database if this.$__.isDeleted is set.
  2. deleteOne() fires deleteOne hooks on subdocs as well.

Examples

Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hasezoey hasezoey added this to the 8.0 milestone Jul 27, 2023
Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/model.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants