From fbb1e9a05d0f576ff4bb274143afc19a468a9cf9 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Thu, 14 Nov 2019 16:07:42 -0500 Subject: [PATCH] re #1207, update mongoose options for fetch example scripts --- server/scripts/examples-gg-latest.js | 3 ++- server/scripts/examples-ml5.js | 5 ++--- server/scripts/examples.js | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/server/scripts/examples-gg-latest.js b/server/scripts/examples-gg-latest.js index 10a3fc05..10ff94e5 100644 --- a/server/scripts/examples-gg-latest.js +++ b/server/scripts/examples-gg-latest.js @@ -66,7 +66,8 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' }; const mongoConnectionString = process.env.MONGO_URL; -mongoose.connect(mongoConnectionString, { useMongoClient: true }); +mongoose.connect(mongoConnectionString, { useNewUrlParser: true, useUnifiedTopology: true }); +mongoose.set('useCreateIndex', true); mongoose.connection.on('error', () => { console.error('MongoDB Connection Error. Please make sure that MongoDB is running.'); process.exit(1); diff --git a/server/scripts/examples-ml5.js b/server/scripts/examples-ml5.js index 0721fe54..84e0a32a 100644 --- a/server/scripts/examples-ml5.js +++ b/server/scripts/examples-ml5.js @@ -30,9 +30,8 @@ const requestOptions = { }; const mongoConnectionString = process.env.MONGO_URL; -mongoose.connect(mongoConnectionString, { - useMongoClient: true -}); +mongoose.connect(mongoConnectionString, { useNewUrlParser: true, useUnifiedTopology: true }); +mongoose.set('useCreateIndex', true); mongoose.connection.on('error', () => { console.error('MongoDB Connection Error. Please make sure that MongoDB is running.'); process.exit(1); diff --git a/server/scripts/examples.js b/server/scripts/examples.js index 465760f8..ff108b9e 100644 --- a/server/scripts/examples.js +++ b/server/scripts/examples.js @@ -40,7 +40,8 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' }; const mongoConnectionString = process.env.MONGO_URL; -mongoose.connect(mongoConnectionString, { useMongoClient: true }); +mongoose.connect(mongoConnectionString, { useNewUrlParser: true, useUnifiedTopology: true }); +mongoose.set('useCreateIndex', true); mongoose.connection.on('error', () => { console.error('MongoDB Connection Error. Please make sure that MongoDB is running.'); process.exit(1);