Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading deprecation warning #5984

Closed
sakalys opened this issue Jan 11, 2018 · 2 comments
Closed

Misleading deprecation warning #5984

sakalys opened this issue Jan 11, 2018 · 2 comments
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone

Comments

@sakalys
Copy link

sakalys commented Jan 11, 2018

Do you want to request a feature or report a bug?
bug

What is the current behavior?
when providing connecting by mongoose.connect('server', {mongos: true}, () => {});,
I get a deprecation warning:

the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,keepAliveInitialDelay,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,checkServerIdentity,validateOptions,appname,auth,user,password,authMechanism,compression,fsync,readPreferenceTags,numberOfRetries,auto_reconnect,minSize]

I get that the the mongos: {...} option is deprecated, but on the other hand this is something different - it's a boolean value that is described in the docs! Ref: http://mongoosejs.com/docs/connections.html#mongos_connections

What is the expected behavior?
The expected behavior is unclear, because I do not get whether the mongos: true option is even relevant anymore.

Please mention your node.js, mongoose and MongoDB version.
Reproducable on:
Node 7.10
MongoDB version: 3.4.9
Mongoose: 4.11 AND 5.0.0-rc2

@vkarpov15
Copy link
Collaborator

Thanks for reporting, will investigate ASAP 👍

@vkarpov15
Copy link
Collaborator

I looked into this and you do not need to specify mongos: true if you're using useMongoClient in ~4.11 or if you're using 5.x. See http://mongodb.github.io/node-mongodb-native/3.0/tutorials/connect/#connect-to-sharded-cluster. I fixed the docs in github and they'll be updated on the docs site when we release 4.13.10 and 5.0.2 👍

@vkarpov15 vkarpov15 added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

No branches or pull requests

2 participants