-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
"bsoncore.Value#String()" is meant be extended JSON but stringifies the timestamp uint32 values for I and U which is antethesis of the expected behavior. This effects both bson.Raw#String() and bson.RawValue#String(). Decoding the stringified value of either will result in the following error:
var doc bson.Raw if err := bson.UnmarshalExtJSON([]byte(cmdCopy.String()), true, &doc); err != nil { // panic: error: $timestamp t value should be uint32, but instead is string panic(fmt.Sprintf("error: %v", err)) }