Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2968

Stop requiring drivers to use Int64 for array indices

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Bulk API
    • None
    • Not Needed

      Summary

      Currently, the specification requires a driver to use `Int64` for indexes of models in the NamespaceWriteModelPair[] array:

      • insertResults: Map<Int64, InsertOneResult>
      • updateResults: Map<Int64, UpdateResult>
      • deleteResults: Map<Int64, DeleteResult>
      • writeErrors: Map<Int64, WriteError>

      In Java, indexes of arrays are int, which means that Map<Integer, ...> makes sense in Java. In Rust, indexes of arrays are usize, which means, that HashMap<usize, ...> probably makes sense in Rust.

      Let's explicitly allow a driver to choose the type that makes best sense for the driver.

      Motivation

      Who is the affected end user?

      The people who implement and maintain drivers, as well as end-users who may have to deal with a sub-optimal API.

      How does this affect the end user?

      They can be annoyed by the sub-optimal API.

      How likely is it that this problem or use case will occur?

      Not applicable.

      If the problem does occur, what are the consequences and how severe are they?

      It affects usability and may make implementing the API more difficult.

      Is this issue urgent?

      It better be addressed before more drivers implement the new bulk write API.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      No.

      Acceptance Criteria

      The specification does not infringe on the driver devs ability to pick the optimal type for array indexes.

            Assignee:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Reporter:
            valentin.kovalenko@mongodb.com Valentin Kavalenka
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: