-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
The removal part of GODRIVER-3227.
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
- Remove or unexport bson.DefaultRegistry in v2.0.
- (Optional) Since a bson.Registry currently uses locks, sharing a bson.Registry between mongo.Client instances will create lock contention between what should be totally isolated types. Consider creating a new registry for every mongo.Client.
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.
- related to
-
GODRIVER-3227 Deprecate "bson.DefaultRegistry"
- Closed