This commit is contained in:
undefined committed 2020-06-26 16:34:37 +08:00
1 parent 560e920624
commit d59710ddf1
13 files changed
+181 -49

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
{
"id": "migrate-vijos",
"version": "1.0.0",
"version": "1.0.1",
"description": "Migrate From Vijos"
}
+5 -1
View File
@@ -308,10 +308,14 @@ async function domainUser(src, report) {
}
}
function addSpace(content) {
return content.split('\n').map((line) => (line.endsWith(' ') ? line : `${line} `)).join('\n');
}
async function fix(doc) {
await dst.collection('document').updateOne(
{ _id: doc._id },
{ $set: { pid: doc.pid || doc.docId.toString() } },
{ $set: { pid: doc.pid || doc.docId.toString(), content: addSpace(doc.content) } },
);
if (doc.data && doc.data.generationTime) {
await file.inc(doc.data);