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

Deprecate "bson.DefaultRegistry"

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.16.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Go Drivers
    • 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?

      The deprecation part of GODRIVER-3142.

      Context

      Currently it's possible to change the behavior of BSON encoding and decoding by modifying bson.DefaultRegistry. That behavior is extremely difficult to test and is easy to break unexpectedly. There are already APIs for setting registries, both for BSON encoders/decoders and for a mongo.Client. We should direct all users to modify BSON registries using those official configurations to prevent unintended behavior regressions when modifying how BSON registries are configured.

      Definition of done

      • Deprecate bson.DefaultRegistry in the next 1.x release. Add a deprecation notice that directs users to use SetRegistry on a bson.Encoder, bson.Decoder, or options.ClientOptions.

      Pitfalls

      • Some people use bson.DefaultRegistry to either access the default registry behavior or to globally modify the default registry. Those users will be impacted by this change and will need to configure their registry using another mechanism.

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

              Created:
              Updated:
              Resolved: