|
@@ -72,8 +72,14 @@ async function run() {
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
console.log("sync update :" + eventDoc.tb + " " + eventDoc.rid);
|
|
console.log("sync update :" + eventDoc.tb + " " + eventDoc.rid);
|
|
|
- // 删除desc和title字段,避免覆盖
|
|
|
|
|
- delete remotedoc.desc;
|
|
|
|
|
|
|
+ if (eventDoc.tb == 'arts') { // art 表需保留新的title,desc,copy 这几个字段,避免覆盖
|
|
|
|
|
+ remotedoc.title = localdoc.title;
|
|
|
|
|
+ remotedoc.desc = localdoc.desc;
|
|
|
|
|
+ remotedoc.copy = localdoc.copy;
|
|
|
|
|
+ } else if (eventDoc.tb == 'albums' || eventDoc.tb == 'videostories') { // albums 和 videostories 表需保留新增的seoTitle,seoDescription字段,避免覆盖
|
|
|
|
|
+ remotedoc.seoTitle = localdoc.seoTitle;
|
|
|
|
|
+ remotedoc.seoDescription = localdoc.seoDescription;
|
|
|
|
|
+ }
|
|
|
await localtb.replaceOne({ _id: eventDoc.rid }, remotedoc);
|
|
await localtb.replaceOne({ _id: eventDoc.rid }, remotedoc);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|