mongo-go-driver icon indicating copy to clipboard operation
mongo-go-driver copied to clipboard

GODRIVER-1808 Fix BSON unmarshaling into an interface containing a concrete value.

Open qingyang-hu opened this issue 1 year ago • 1 comments

GODRIVER-1808

Summary

This PR fixes BSON's unmarshaling behavior for interfaces by passing reflect.Value instead of reflect.Type, so the actual value type contained in the interface can be used. Especially for an interface containing a pointer, this PR unmarshals value into the pointed concrete value.

Background & Motivation

This PR provides a more flexible way of unmarshaling and makes the behavior closer to the JSON package.

qingyang-hu avatar Mar 20 '24 18:03 qingyang-hu

API Change Report

./bson

incompatible changes

DefaultValueDecoders.ByteSliceDecodeValue: removed DefaultValueDecoders.EmptyInterfaceDecodeValue: removed DefaultValueDecoders.MapDecodeValue: removed DefaultValueDecoders.SliceDecodeValue: removed DefaultValueDecoders.StringDecodeValue: removed DefaultValueDecoders.TimeDecodeValue: removed DefaultValueDecoders.UintDecodeValue: removed