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#1 display visited page count #9

Merged
merged 2 commits into from
Oct 26, 2019

Conversation

haichuan0424
Copy link

I examined the code and found out that when the user tries to login, the visit record does not include the "page" key, so the visits collection has null values for page. When the visits.aggregate function in the mongo.js file tries to create _id based on page, there will be null value, so the aggregate does not return any data.

I fixed the exports.login function to only save to visits collection if the user exists and add a page key/value pair before saving to database. Please let me know if any issues or further need.

@Tubaleviao Tubaleviao merged commit 4df8893 into Tubaleviao:master Oct 26, 2019
@Tubaleviao
Copy link
Owner

Nice, this is a good beginning. But this don't correct the error completely, we are still not able to see the user's visits.
Nice job!

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.

2 participants