From 9127d8f553b68f19ac51fa31da034ecc8ce0b5a7 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Tue, 26 Dec 2017 22:21:02 -0500 Subject: [PATCH] trying this again --- server/migrations/moveBucket.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/migrations/moveBucket.js b/server/migrations/moveBucket.js index 165b0a1e..6ecf68ef 100644 --- a/server/migrations/moveBucket.js +++ b/server/migrations/moveBucket.js @@ -26,13 +26,13 @@ mongoose.connection.on('error', () => { const CHUNK = 1000; Project.count({}) -.exec().then((numProjects) => { +.exec().then(async (numProjects) => { console.log(numProjects); for (let i = 0; i < numProjects; i += CHUNK) { let projects = await Project.find({}).skip(i).limit(CHUNK).exec(); projects.forEach((project, projectIndex) => { console.log(project.name); - project.files.forEach((file, fileIndex) => { + project.files.forEach((async file, fileIndex) => { if (file.url && file.url.includes('p5.js-webeditor')) { file.url = file.url.replace('p5.js-webeditor', process.env.S3_BUCKET); }