-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this 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 :)
up(db, next) { | ||
// update records | ||
const users = db.collection('users'); | ||
users.find({}).snapshot().forEach( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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)
Removed migrations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.