• Type: Icon: Epic Epic
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.16.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 2
    • 1
    • 2
    • 100
    • Hide

      Engineer: Andreas Braun
      Summary: Improve handling of 64-bit integers by allowing users to round-trip 32-bit values as 64-bit numbers in BSON and allow usage as if it were a number

      2023-05-12

      • Opened constructor to allow users to create objects
      • Implemented operator overloading for arithmetic and bitwise operator
      • Implemented casting rules to other types (e.g. bool)
      Show
      Engineer: Andreas Braun Summary: Improve handling of 64-bit integers by allowing users to round-trip 32-bit values as 64-bit numbers in BSON and allow usage as if it were a number 2023-05-12 Opened constructor to allow users to create objects Implemented operator overloading for arithmetic and bitwise operator Implemented casting rules to other types (e.g. bool)

      Summary

      PHPC currently only uses Int64 objects when necessary, i.e. on 32-bit platforms to represent BSON int64 values that are beyond the range of 32-big signed integers. Whenever possible, BSON int64 values are returned as PHP integer types in the interest of usability. This design dates back to the legacy PHP driver.

      This epic will collect various issues to improve usability when working with Int64 objects and BSON int64 types. It is meant to complement related tickets (e.g. PHPC-326, PHPC-2206) that will also grant users more control over reading/writing BSON and preserving types.

      Motivation

      Who is the affected end user?

      Users that encounter Int64 objects or need to explicitly create BSON int64 types.

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

      32-bit PHP platforms are growing increasingly rare; however, MongoDB features such as CSFLE and JSON schema mean that users may be more likely to care about BSON types (particularly int32 and int64).

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

      Users may encounter unexpected schema validation errors. BSON int64 types could be converted to int32 when round-tripping through PHP.

      These are mostly minor annoyances and should not seriously affect data integrity, considering that PHP's logic mirrors the server's own behavior of encoding integer values as int32 whenever possible.

      Cast of Characters

      Engineering Lead:
      Document Author:
      POCers:
      Product Owner:
      Program Manager:
      Stakeholders:

      Channels & Docs

      Slack Channel

      [Scope Document|some.url]

      [Technical Design Document|some.url]

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              2 weeks, 3 days