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: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers

      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”.

      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: