-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Go Drivers
-
Not Needed
-
Context
In GODRIVER-3285, we plan to add the “sort” option to the “UpdateOne” operation alone because the server throws an error when "sort" is passed with "UpdateMany". Considering the “UpdateMany” and “UpdateOne” sharing the “UpdateOptions” struct in the Go driver currently, it’s better to separate “UpdateOneOptions” and “UpdateManyOptions” in 2.0 to:
- increase the consistency that each operation has its option struct;
- align with the bulk write models.
Another similar case on the radar is the “DeleteOptions” struct, which is shared by both “DeleteOne” and “DeleteMany”. Although there is no immediate requirement yet, we can still consider a division for the possibility of future changes.
Definition of done
- Separate the “UpdateOptions” struct into “UpdateManyOptions” and “UpdateOneOptions”.
- Separate the “DeleteOptions” struct into “DeleteManyOptions” and “DeleteOneOptions”.
- Update v2.0 migration guide.
Pitfalls
What should the implementer watch out for? What are the risks?
- has to be done before
-
GODRIVER-3285 Allow update to supply sort option
- In Progress