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

User defined mongo connection options API for #6958 #7277

Merged
merged 1 commit into from Jun 23, 2016

Conversation

Projects
None yet
3 participants
@dburles
Contributor

dburles commented Jun 23, 2016

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.

// 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;

This comment has been minimized.

@tmeasday

tmeasday Jun 23, 2016

Contributor

Has this poolSize option changed? If so we should probably fix this

This comment has been minimized.

@dburles

dburles Jun 23, 2016

Contributor

Only in how you pass it in, the new mongo driver takes care of where it needs to go

This comment has been minimized.

@tmeasday

tmeasday Jun 23, 2016

Contributor

Does the old code work though? It seems surprising that this passed our testing of the new driver..

This comment has been minimized.

@dburles

dburles Jun 23, 2016

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.

This comment has been minimized.

@tmeasday

tmeasday Jun 23, 2016

Contributor

Maybe remove this from the PR then, I think it muddies the waters a little

This comment has been minimized.

@dburles

dburles Jun 23, 2016

Contributor

Sure thing

check(options, Object);
Mongo._connectionOptions = options;
}

This comment has been minimized.

@tmeasday

tmeasday Jun 23, 2016

Contributor

Can we add some jsdoc for this also?

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Jun 23, 2016

Looking good @dburles

@dburles

This comment has been minimized.

Contributor

dburles commented Jun 23, 2016

For reference here's the relevant docs for the newer options http://mongodb.github.io/node-mongodb-native/2.1/reference/connecting/connection-settings/

@dburles dburles changed the title from first pass at custom mongo connection options api for #6958 to User defined mongo connection options API for #6958 Jun 23, 2016

@dburles

This comment has been minimized.

Contributor

dburles commented Jun 23, 2016

/**
* @summary Allows for user specified connection options
* @locus Server
* @param {Object} options User specified Mongo connection options

This comment has been minimized.

@tmeasday

tmeasday Jun 23, 2016

Contributor

Can we add a link to the mongo docs so people know what these options are?

This comment has been minimized.

@dburles

dburles Jun 23, 2016

Contributor

Done

@dburles dburles force-pushed the dburles:mongo-connection-options branch from baec319 to edb56af Jun 23, 2016

@benjamn benjamn merged commit c87fcaa into meteor:release-1.4 Jun 23, 2016

3 checks passed

CLA Author has signed the Meteor CLA.
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dburles

This comment has been minimized.

Contributor

dburles commented Jun 25, 2016

Just a heads up, this was definitely merged, but for some reason now it's not included in the release-1.4 branch

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Jun 26, 2016

Any idea what happened here @benjamn?

benjamn added a commit that referenced this pull request Jun 26, 2016

Merge pull request #7277 from dburles/mongo-connection-options
User-defined Mongo.setConnectionOptions API for #6958.
@benjamn

This comment has been minimized.

Member

benjamn commented Jun 27, 2016

Not sure why it disappeared, but I've cherry-picked it back onto release-1.4: 2654fe6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment