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

Bug/800 user tag update #14

Merged
merged 11 commits into from
Oct 9, 2018
Merged

Bug/800 user tag update #14

merged 11 commits into from
Oct 9, 2018

Conversation

ciaranschutte
Copy link
Contributor

No description provided.

Copy link
Contributor

@hlminh2000 hlminh2000 left a comment

Choose a reason for hiding this comment

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

@ra-ver Wanna get some of your thoughts on this :)

src/schema/User.js Outdated Show resolved Hide resolved
migrations/20180927201954-lowercase_user_interests.js Outdated Show resolved Hide resolved
up(db, next) {
// update records
const users = db.collection('users');
users.find({}).snapshot().forEach(
Copy link
Contributor

Choose a reason for hiding this comment

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

@ra-ver I don't think this will be an issue at current volume, but wanna bring it to your attention just in case.
This loads up all the user data into memory and writes a transformed version back. Just wanna make sure we're not gonna run out of memory in whatever vm we'll be running this in.

Copy link
Contributor

Choose a reason for hiding this comment

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

non problem, just checked current prod persona, it's just 179 KB right now :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hlminh2000 does a foreach load everything into memory? I could be reading this link incorrectly, but it sounds like a doc is loaded into memory once you operate on it. So toArray would load everything but foreach would load each one?

(https://stackoverflow.com/questions/25507866/how-can-i-use-a-cursor-foreach-in-mongodb-using-node-js)

config.js Outdated Show resolved Hide resolved
@hlminh2000 hlminh2000 requested a review from ra-ver October 1, 2018 16:35
@ciaranschutte
Copy link
Contributor Author

Removed migrations.
Only User schema change in this PR now.

Copy link
Contributor

@hlminh2000 hlminh2000 left a comment

Choose a reason for hiding this comment

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

👍

@hlminh2000 hlminh2000 merged commit d8357b0 into master Oct 9, 2018
@hlminh2000 hlminh2000 deleted the bug/800-user-tag-update branch October 9, 2018 18:13
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.

None yet

2 participants