Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2796 Update ObjectIDAsHexString behavior. #1694

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

qingyang-hu
Copy link
Collaborator

GODRIVER-2796

Summary

  • Update ObjectIDAsHexString behavior: disable DecodeObjectIDAsHex and return an error by default
  • Cleanup EncodeContext and DecodeContext.

Background & Motivation

@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the priority-3-low Low Priority PR for Review label Jun 28, 2024
Copy link

API Change Report

./bson

incompatible changes

(*DecodeContext).BinaryAsSlice: removed
(*DecodeContext).DefaultDocumentD: removed
(*DecodeContext).DefaultDocumentM: removed
(*DecodeContext).UseJSONStructTags: removed
(*DecodeContext).UseLocalTimeZone: removed
(*DecodeContext).ZeroMaps: removed
(*DecodeContext).ZeroStructs: removed
(*EncodeContext).ErrorOnInlineDuplicates: removed
(*EncodeContext).NilByteSliceAsEmpty: removed
(*EncodeContext).NilMapAsEmpty: removed
(*EncodeContext).NilSliceAsEmpty: removed
(*EncodeContext).OmitZeroStruct: removed
(*EncodeContext).StringifyMapKeysWithFmt: removed
(*EncodeContext).UseJSONStructTags: removed
DecodeContext.Truncate: removed
EncodeContext.MinSize: removed
IsValidObjectID: removed
ValueCodec: removed

compatible changes

(*Decoder).ObjectIDAsHexString: added

@@ -75,6 +76,30 @@ func NewRespectNilValuesMgoRegistry() *Registry {
return reg
}

func mgoStringDecodeValue(dc DecodeContext, vr ValueReader, val reflect.Value) error {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the compatible mgo behavior.

@qingyang-hu qingyang-hu marked this pull request as ready for review June 28, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-3-low Low Priority PR for Review
Projects
None yet
1 participant