[GODRIVER-2954] Make defining a "majority" write concern literal easier Created: 22/Aug/23 Updated: 10/Nov/23 Resolved: 10/Nov/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Read and Write Concern |
| Affects Version/s: | 1.12.0 |
| Fix Version/s: | 2.0.0 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Matt Dale | Assignee: | Preston Vasquez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | Go Driver 2.0: Driver | ||||||||
| Quarter: | FY24Q3 | ||||||||
| Backwards Compatibility: | Major Change | ||||||||
| Documentation Changes: | Not Needed | ||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||
| Description |
|
The new API for creating write concerns (added in v1.12.0) only includes a single way to create a write concern with w:majority: the writeconcern.Majority convenience function. If users want to define a write concern literal for w:majority, ..., they have to define their own string:
or use the Majority function to get the "w" field:
Definition of done:
|
| Comments |
| Comment by Githook User [ 10/Nov/23 ] | |
|
Author: {'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}Message: | |
| Comment by Matt Dale [ 22/Aug/23 ] | |
|
One option is to define a constant for write concern majority, like
However, there is already a function with that name, so we'd have to call it something else or wait until Go Driver 2.0. |