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

multiple DB calls while using findById #87

Closed
mlakdawala-sf opened this issue Sep 2, 2022 · 1 comment · Fixed by #88
Closed

multiple DB calls while using findById #87

mlakdawala-sf opened this issue Sep 2, 2022 · 1 comment · Fixed by #88
Assignees
Labels

Comments

@mlakdawala-sf
Copy link

FindById has the below statement which can be reduced by checking the deleted flag and in turn improving performance
const entityToRemove = await super.findOne(filter, options);
if (entityToRemove) {
// Now call super
return super.findById(id, filter, options);
}
else {
throw new rest_1.HttpErrors.NotFound("EntityNotFound" /* ErrorKeys.EntityNotFound */);
}

@mlakdawala-sf mlakdawala-sf changed the title Multiple DB calls while using findById multiple DB calls while using findById Sep 2, 2022
@yeshamavani yeshamavani self-assigned this Sep 5, 2022
@yeshamavani
Copy link
Contributor

🎉 This issue has been resolved in version 5.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants