Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4892

Add versioning to bson type classes and assert version in serialize and stringify

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • bson-5.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 3
    • Needed
    • Not Needed

      Use Case

      As a node engineer
      I want to ensure BSON input types are from the same version as the serializer/stringifier using them
      So that there are no unexpected errors or silent serialization issues caused by the mixing of bson versions

      User Impact

      • BSON v5 serializer and stringify will throw if given types from a BSON version that is not v5

      Unknowns

      • Will we ship this? Yes

      Acceptance Criteria

      Implementation Requirements

      • Add Symbol.for('@@mdb.bson.version') property to all bson type classes and set it to 5
      • Validate that if a bsontype is detected it has the version number set as expected

      Testing Requirements

      • Test that types without a version property throw errors
      • Test that type with a version property serialize as expected

      Documentation Requirements

      • Migration guide will have a section on the explicity incompatibility and what the expected support is (all 5.x.x versions work with each other)

      Follow Up Requirements

      • Release an alpha with this change and follow up with downstream teams.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: