Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3339

Separate "Many" and "One" for "UpdateOptions" and "DeleteOptions"

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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:

      1. increase the consistency that each operation has its option struct;
      2. 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

      1. Separate the “UpdateOptions” struct into “UpdateManyOptions” and “UpdateOneOptions”.
      2. Separate the “DeleteOptions” struct into “DeleteManyOptions” and “DeleteOneOptions”.
      3. Update v2.0 migration guide.

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            qingyang.hu@mongodb.com Qingyang Hu
            Reporter:
            qingyang.hu@mongodb.com Qingyang Hu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: