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

No need to run User.find() twice to check unique username and email #2

Open
Pankajtanwarbanna opened this issue Jun 7, 2020 · 0 comments

Comments

@Pankajtanwarbanna
Copy link

Hi,

Good work @rooneyrulz ! While exploring your project, i have found that in user.js ( Route ), you have used .find method twice to check username and email which can cause your performance issues as executing .find twice will double the response time which is not recommended for large scale applications.

I think, you can create a new User object with user details and save them to database, it will return duplication errors if any and it is much faster then executing user.find() method twice.

Thanks

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

No branches or pull requests

1 participant