options are deprecated, all their options are supported at the top level of the options object


options are deprecated, all their options are supported at the top level of the options object

Simply move the settings from the server, replset, and mongos keys up into the top level of the object.

1
2
3
4
5
6
7
8
9
mongoose.connect( 'mongodb://localhost/db',
{
useMongoClient: true,
server: {
poolSize: 2
},
promiseLibrary: global.Promise
}
);

turns into

1
2
3
4
5
6
7
mongoose.connect( 'mongodb://localhost/db',
{
useMongoClient: true,
poolSize: 2,
promiseLibrary: global.Promise
}
);