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-2416 Completely remove the 'x/bsonx' package. #1122

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

matthewdale
Copy link
Collaborator

@matthewdale matthewdale commented Nov 6, 2022

GODRIVER-2416

Summary

Completely remove the x/bsonx package.

Background & Motivation

One of the main goals of the Go Driver 2.0 changes is to reduce code duplication and restructure packages in the Go Driver to minimize import cycles. Some of that restructuring exposes unknown dependencies between packages that must be "untangled" to allow them to operate independently. The x/bsonx package imports some bson packages, complicating the restructuring of those packages. Because it is unsupported and effectively unused, we should remove it.

Completely remove the x/bsonx package to remove an unsupported API and simplify future restructuring of the bson packages. Note that this is a continuation of the work started in GODRIVER-1953 and GODRIVER-1969.

@matthewdale matthewdale force-pushed the godriver2416-remove-bsonx branch 3 times, most recently from 2a2cde1 to ade78f2 Compare November 10, 2022 22:05
@matthewdale matthewdale marked this pull request as ready for review November 15, 2022 02:46
Copy link
Collaborator

@qingyang-hu qingyang-hu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Hooray for removed code. LGTM with a change to benchmark/single.go.

benchmark/single.go Outdated Show resolved Hide resolved
@matthewdale matthewdale merged commit 63d46a3 into mongodb:master Nov 16, 2022
admpub pushed a commit to webx-top/qmgo that referenced this pull request Nov 25, 2023
…qiniu#297)

This package is gone after mongodb/mongo-go-driver#1122,
which is included in mongo-go-driver v1.12.0. Replace the only usage
site with the better supported equivalent.
@fabszabo
Copy link

fabszabo commented Apr 15, 2024

You have released this breaking change in a "feature" release?! 1.11.7 -> 1.12.0?!

Even your Jira ticket says it's supposed to be in version 2!

There is no reference to breaking changes in the release notes either. This is not okay.

@matthewdale
Copy link
Collaborator Author

@fabszabo Apologies for any negative impact removing the x/bsonx package had on you.

The packages in the x/ directory are documented as unstable and subject to breaking changes without notice. I realize that README may be easy to miss, so we're planning to make that warning more obvious in a future release (see GODRIVER-3180).

Please use the following replacements from the bson package instead:

  • bsonx.Doc ->
    • For Go representation, use bson.D
    • For binary representation, use bson.Raw
  • bsonx.Val -> bson.RawValue
  • bsonx.ReadDoc ->
    • For Go representation, use bson.Unmarshal with a bson.D as the val argument.
    • For binary representation, use bson.ReadDocument
  • bsonx.MDoc ->
    • For Go representation, use bson.M
    • For binary representation, use bson.Raw
  • bsonx.ReadMDoc ->
    • For Go representation, use bson.Unmarshal with a bson.M as the val argument.
    • For binary representation, use bson.ReadDocument

If you need more help replacing usages of the x/bsonx package, please create a Jira ticket in the GODRIVER project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants