|
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.
|