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

Allow using bools for writeConcern #151

Merged
merged 1 commit into from
Jan 11, 2017
Merged

Conversation

alcaeus
Copy link
Owner

@alcaeus alcaeus commented Jan 11, 2017

Fixes #146. While MongoCollection::setWriteConcern expects the w option to be a string or integer, one can pass a boolean as w option to insert and update commands. To avoid a BC break for people who might have been using this undocumented feature, the WriteConcernConverter will cast a bool to int, resulting in a valid writeConcern object. While this will cause a minor inconsistency in MongoCollection::setWriteConcern (which no longer throws an error in the adapter), avoiding the BC break has priority.

@alcaeus alcaeus force-pushed the write-concern-inconsistencies branch from ad71afb to 6711979 Compare January 11, 2017 20:13
@alcaeus alcaeus merged commit 350f09b into 1.0.x Jan 11, 2017
@alcaeus alcaeus deleted the write-concern-inconsistencies branch January 11, 2017 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant