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

Decouple BSON type interpretation from BSON type structure

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON

      Description

      Cross compatibility between BSON versions is desirable as there can be cases where one has a version installed as a direct dependency of the library along with the driver that has its own different version. Maintaining this compat means keeping the serializer implemented in a way that doesn't access a BSON type object differently than it has in the past (inspect the same properties etc.), as well as keeping the types the same shape and typed the same as they were in previous versions. This can make it quite difficult to change or update components of the BSON library while ensuring we keep types + serializer working in both legacy and modern versions of the library.

      Related Work

      On-demand BSON Access proposes a deserializer that returns a descriptive format of a BSON object. While it hasn't been finalized it is something along the lines of an ordered list of some struct containing element type, element name, element value. We should consider reworking the serializer to operate on a more abstract structure like that and make the BSON type classes offer a way to transform themselves into that simplified struct. Then the specifics of, say, an ObjectId's implementation is not important to the serializer, only that it provides a way to obtain what BSON format it should become (type 0x07, name and 12 byte sequence).

      AC

      • File a Writing ticket and EPIC
      • TBD

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

              Created:
              Updated: