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

fix: delete operation in MongoDB impact all matched documents #7811

Merged
merged 1 commit into from Jun 29, 2021

Conversation

SnapeEye
Copy link
Contributor

@SnapeEye SnapeEye commented Jun 29, 2021

Delete operation should remove all matched documents, but now it removes the first found document

Closes: #7809

Description of change

In current solution, when you perform delete operation for MongoDB, only the first found document, that is matching the search condition, is removed. This PR is fixing this problem, removing all documents which are supposed to be removed making delete operation.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

Delete operation should remove all matched documents, but now it removes the first found document

Closes: typeorm#7809
@SnapeEye
Copy link
Contributor Author

Related changes, but for update oparation: #7803

Copy link
Contributor

@imnotjames imnotjames left a comment

Choose a reason for hiding this comment

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

This makes sense to me.

@imnotjames imnotjames merged commit 0fbae53 into typeorm:master Jun 29, 2021
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.

MongoDB delete make changes only to first matched document
2 participants