mongoose-simpledb icon indicating copy to clipboard operation
mongoose-simpledb copied to clipboard

Options is throwing an error

Open JonTDev opened this issue 6 years ago • 0 comments

Sorry I am new to the git world, however I believe it requires I have permissions to create a branch.

So I forked it and ( https://github.com/JonTDev/mongoose-simpledb/blob/master/index.js )

Options is throwing an error due to the settings being passed at time of connection to the mongodb server.

( the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object )

The error can be referenced on the Mongoose website.

http://mongoosejs.com/docs/connections.html Can find mention of it @ header( Option Changes in v5.x )

You just call it from the root of the options being passed. So we needed to remove the server key.

Then socketOptions is also no longer an option. From what i can tell Mongoose changed it to socketTimeoutMS and keepAlive is now on its own.

Ending Results and successfully worked.

options: { socketTimeoutMS: 0, keepAlive: true, reconnectTries: 30 }

Thanks for the awesome class! It really did make my life a great deal easier, espically with referring of other collecitons. Made my life SUPER easier!

JonTDev avatar Apr 29 '18 06:04 JonTDev