GODRIVER-2367 Un-export all result type BSON encoding logic #1442
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.