Skip to content

Instantly share code, notes, and snippets.

@terakilobyte
Last active August 29, 2015 14:13
Show Gist options
  • Save terakilobyte/4761b14db78e969bfbe9 to your computer and use it in GitHub Desktop.
Save terakilobyte/4761b14db78e969bfbe9 to your computer and use it in GitHub Desktop.
User.find({'profile.picture': /twimg.*_normal/}, function(err, users, done) {
if (err) { debug('Username err: ', err); next(err); }
for (var i = 0; i < users.length; i++) {
console.log(users[i].profile.picture);
users[i].profile.picture = users[i].profile.picture.replace('_normal', '');
users[i].save(function(err) {
if (err) { return next(err); }
done(err, user);
});
console.log(users[i].profile.picture);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment