User defined mongo connection options API for #6958 #7277
Conversation
// set it for replSet, it will be ignored if we're not using a replSet. | ||
mongoOptions.server.poolSize = options.poolSize; | ||
mongoOptions.replSet.poolSize = options.poolSize; | ||
mongoOptions.poolSize = options.poolSize; |
tmeasday
Jun 23, 2016
Contributor
Has this poolSize
option changed? If so we should probably fix this
Has this poolSize
option changed? If so we should probably fix this
dburles
Jun 23, 2016
Author
Contributor
Only in how you pass it in, the new mongo driver takes care of where it needs to go
Only in how you pass it in, the new mongo driver takes care of where it needs to go
tmeasday
Jun 23, 2016
Contributor
Does the old code work though? It seems surprising that this passed our testing of the new driver..
Does the old code work though? It seems surprising that this passed our testing of the new driver..
dburles
Jun 23, 2016
Author
Contributor
Oh right yeah, well as far as I've looked into things it seems like legacy options will work just fine, though I'm not totally sure what happens with safe
, I think it may just be ignored as it's the default on later Mongo, but I could be wrong.
Oh right yeah, well as far as I've looked into things it seems like legacy options will work just fine, though I'm not totally sure what happens with safe
, I think it may just be ignored as it's the default on later Mongo, but I could be wrong.
tmeasday
Jun 23, 2016
Contributor
Maybe remove this from the PR then, I think it muddies the waters a little
Maybe remove this from the PR then, I think it muddies the waters a little
dburles
Jun 23, 2016
Author
Contributor
Sure thing
Sure thing
check(options, Object); | ||
Mongo._connectionOptions = options; | ||
} | ||
|
tmeasday
Jun 23, 2016
Contributor
Can we add some jsdoc for this also?
Can we add some jsdoc for this also?
Looking good @dburles |
For reference here's the relevant docs for the newer options http://mongodb.github.io/node-mongodb-native/2.1/reference/connecting/connection-settings/ |
Seems pretty good now https://github.com/meteor/meteor/pull/7277/files |
/** | ||
* @summary Allows for user specified connection options | ||
* @locus Server | ||
* @param {Object} options User specified Mongo connection options |
tmeasday
Jun 23, 2016
Contributor
Can we add a link to the mongo docs so people know what these options are?
Can we add a link to the mongo docs so people know what these options are?
dburles
Jun 23, 2016
Author
Contributor
Done
Done
Just a heads up, this was definitely merged, but for some reason now it's not included in the |
Any idea what happened here @benjamn? |
User-defined Mongo.setConnectionOptions API for #6958.
Not sure why it disappeared, but I've cherry-picked it back onto release-1.4: 2654fe6 |
For #6958
I noticed the API has changed for a bunch of the existing options used in
mongo_driver.js
such as{ safe: true }
now replaced by: https://docs.mongodb.com/manual/core/replica-set-write-concern/ but that is a bit out of scope for this PR. Maybe something to be looked at though.