re #1207, update mongoose options for fetch example scripts
This commit is contained in:
parent
7135f5fabd
commit
fbb1e9a05d
3 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue