-
Notifications
You must be signed in to change notification settings - Fork 892
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-2367 Un-export all result type BSON encoding logic #1442
Conversation
API Change Report./mongoincompatible changes(*CollectionSpecification).UnmarshalBSON: removed ./mongo/gridfsincompatible changes(*File).UnmarshalBSON: removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good to merge as long as we update the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
GODRIVER-2367
Summary
Remove the mongo.UpdateResult.UnmarshalBSON function and remove the BSON struct tags from mongo.DeleteResult. Additionally, remove other result types support unmarshaling from BSON via an exported UnmarshalBSON function:
Background & Motivation
The BSON unmarshaling logic occasionally deviates from the logic used to construct result types in the operation layer. The capability to directly unmarshal from BSON seems to be a remnant from a previous version of the driver, predating the CRUD spec tests.
In principle, this change could be disruptive because some users might unintentionally rely on the decoding logic being removed in this pull request. However, it's worth noting that none of the unmarshal behavior being removed is symmetrical. In other words, there are no encoders available for any of the result data. Consequently, the use of unmarshal is limited to users who are manually encoding the result data themselves, which is a complex and therefore infrequent practice.