Revert "Mongoose 4.13 (#9926)" (#9927)

This reverts commit 7859f20a40.
This commit is contained in:
Matteo Pagliazzi
2018-02-02 16:36:54 +01:00
committed by GitHub
parent 7859f20a40
commit b430b6ccb6
8 changed files with 340 additions and 531 deletions

View File

@@ -1,4 +1,5 @@
import mongoose from 'mongoose';
import autoinc from 'mongoose-id-autoinc';
import logger from '../website/server/libs/logger';
import nconf from 'nconf';
import repl from 'repl';
@@ -27,13 +28,15 @@ let improveRepl = (context) => {
replset: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
server: { socketOptions: { keepAlive: 1, connectTimeoutMS: 30000 } },
};
mongoose.connect(
nconf.get('NODE_DB_URI'),
mongooseOptions,
(err) => {
if (err) throw err;
logger.info('Connected with Mongoose');
}
autoinc.init(
mongoose.connect(
nconf.get('NODE_DB_URI'),
mongooseOptions,
(err) => {
if (err) throw err;
logger.info('Connected with Mongoose');
}
)
);
};