Answers for "Contentful Migration - Transform Entires"

0

Contentful Migration - Transform Entires

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 };
    }
  });
Posted by: Guest on August-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language