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);