Created
May 6, 2019 10:06
-
-
Save atlanmatrix/6ca56fca51b583d4423a410dcd8e7381 to your computer and use it in GitHub Desktop.
This file contains 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.getCollection('page').find({site:"cotaiwaterjet", lan:"en"}).forEach(function(doc){ | |
delete doc["_id"] | |
if (doc.page_name) { | |
doc['lan'] = 'ko' | |
page_name_list = doc.page_name.split('') | |
page_name_list[0] = 'k' | |
page_name_list[1] = 'o' | |
doc['page_name'] = page_name_list.join('') | |
db.page.insertOne(doc) | |
doc['lan'] = 'jp' | |
page_name_list = doc.page_name.split('') | |
page_name_list[0] = 'j' | |
page_name_list[1] = 'p' | |
doc['page_name'] = page_name_list.join('') | |
db.page.insertOne(doc) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment