📜  内容迁移 - 转换整体 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:12.883000             🧑  作者: Mango

代码示例1
migration.transformEntries({
    contentType: 'newsArticle',
    from: ['author', 'authorCity'],
    to: ['byline'],
    transformEntryForLocale: function (fromFields, currentLocale) {
      if (currentLocale === 'de-DE') {
        return;
      }
      const newByline = `${fromFields.author[currentLocale]} ${fromFields.authorCity[currentLocale]}`;
      return { byline: newByline };
    }
  });