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

Gh 9374 from 6.0 #9941

Merged
merged 1 commit into from Apr 14, 2021
Merged

Gh 9374 from 6.0 #9941

merged 1 commit into from Apr 14, 2021

Conversation

Rossh87
Copy link
Contributor

@Rossh87 Rossh87 commented Feb 16, 2021

Summary
Implements sensible defaults discussed in #9374 if connection readPreference is 'secondary' or 'preferSecondary'. If readPreference will be set to 'nearest' or 'primaryPreferred', it warns but otherwise behaves as before.
Examples
Several tests added for Mongoose.prototype.connect and Mongoose.prototype.createConnection.

@Rossh87 Rossh87 changed the base branch from master to 6.0 February 16, 2021 04:17
lib/helpers/processConnectionOptions.js Outdated Show resolved Hide resolved
test/collection.test.js Outdated Show resolved Hide resolved
lib/helpers/processConnectionOptions.js Outdated Show resolved Hide resolved
…ry connections

MongoDB will not allow index creation on a non-primary replica.
If user-specified connection explicitly sets index creation  options,
and specifies secondary read preference, throw.  Otherwise, default
index options to false.
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks 👍

@vkarpov15 vkarpov15 added this to the 6.0 milestone Apr 14, 2021
@vkarpov15 vkarpov15 merged commit bd50e0d into Automattic:6.0 Apr 14, 2021
vkarpov15 added a commit that referenced this pull request Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants