-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Options & Configuration
-
None
-
Not Needed
-
GODRIVER-2716 adds a new API for configuring bson.Encoder and bson.Decoder that significantly simplifies applying many configurations compared to overriding the default Registry. However, users need a way to apply those configurations in mongo.Connect via ClientOptions.
An example options struct:
type BSONOptions struct { Registry *bsoncodec.Registry AllowUnexported bool UseJSONStructTags bool EncodeIntMinSize bool EncodeMapKeysWithStringer bool EncodeNilByteSliceAsEmpty bool EncodeNilMapAsEmpty bool EncodeNilSliceAsEmpty bool EncodeOmitDefaultStruct bool EncodeOverwriteInlineDuplicates bool DecodeDefaultDocumentM bool DecodeBinaryAsSlice bool DecodeObjectIDAsHexString bool DecodeZerosMap bool DecodeZerosStruct bool }
Definition of done:
- Users have a way to set all bson.Encoder and bson.Decoder configuration options in a ClientOptions passed to mongo.Connect (including setting a Registry).
- Deprecate ClientOptions.Registry and ClientOptions.SetRegistry.
- depends on
-
GODRIVER-2716 Deprecate all "bsoncodec.*Codec" types
- Closed
- is depended on by
-
GODRIVER-2743 Expose an API to create a cursor from a command response
- Closed