Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Correct traffic migration script for paths & referrers
Browse files Browse the repository at this point in the history
  • Loading branch information
geneh committed Jul 17, 2017
1 parent 20aed80 commit 9671af6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jobs/oneTimeMigrateTrafficData.js
Expand Up @@ -114,7 +114,12 @@ function transformEntities({ blobName, entities }) {
console.log(`Skipping ${entity} in ${blobName} due to missing data.`);
continue;
}
const outputDocument = doc.data;
let outputDocument = doc.data;
if (['paths', 'referrers'].includes(doc.category)) {
outputDocument = {
elements: doc.data
};
}
outputDocument.id = date;
outputDocument._metadata = {
type: doc.category,
Expand Down

0 comments on commit 9671af6

Please sign in to comment.