Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2684

Deprecate "bson.D.Map"

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Unknown Unknown
    • 1.12.0
    • None
    • None
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      Using the bson.D.Map method often results in unexpected output because the method only shallow-converts the D to an M. Updating the method to recursively convert a D to an M requires a lot of reflection logic and would be a backward-breaking behavior change in Go Driver 1.x. The only use case for converting a D to an M that we have observed it to marshal the D to an intuitive JSON representation (i.e. key-value instead of an array of tuples). In Go Driver 2.0, encoding to the intuitive JSON representation will be supported natively (see GODRIVER-1765), so the Map method will have no known use cases.

      Definition of done:

      • Deprecate bson.D.Map. Recommend that users marshal a bson.D as BSON and unmarshal it as a bson.M to achieve the same D-to-M conversion.

      Attachments

        Activity

          People

            matt.dale@mongodb.com Matt Dale
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: