Last active
October 12, 2016 13:39
-
-
Save kaworu/ed99c55ed094005b47ab1c61526b66ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.tickets.find({'contact.portrait': {$exists: true}}).snapshot().forEach( | |
function (ticket) { | |
var rfc2397_portrait = 'data:' + ticket.contact.portrait['mime-type'] + ";base64," + ticket.contact.portrait.data.base64(); | |
db.tickets.update({_id: ticket._id}, | |
{ | |
$set: { | |
'contact.rfc2397_portrait': rfc2397_portrait, | |
}, | |
$unset: { | |
'contact.portrait': true, | |
}, | |
} | |
); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment