[GODRIVER-2416] Completely remove "x/bsonx" package and types Created: 09/May/22  Updated: 29/Nov/23  Resolved: 17/Nov/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.12.0, 1.12.0-alpha1

Type: Task Priority: Unknown
Reporter: Matt Dale Assignee: Matt Dale
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on GODRIVER-1969 Convert GridFS spec tests to unified ... Closed
is depended on by GODRIVER-2611 Merge the "primitive" package into th... Blocked
Related
is related to GODRIVER-1953 Remove usages of "x/bsonx" BSON API f... Closed
Epic Link: Go Driver 2.0 Scope
Quarter: FY23Q4

 Description   

Following up on GODRIVER-1953, remove all code from the x/bsonx package.

Note: depending on our interpretation of the Go Driver 1.x compatibility guarantee, we may need to wait for Go Driver v2.0 to make this change.



 Comments   
Comment by Darko Luketic [ 29/Nov/23 ]

```

go mod tidy
go: finding module for package go.mongodb.org/mongo-driver/x/bsonx
go: code.icod.de/dalu/iloveu/cmd imports
    go.mongodb.org/mongo-driver/x/bsonx: module go.mongodb.org/mongo-driver@latest found (v1.13.0), but does not contain package go.mongodb.org/mongo-driver/x/bsonx

```

Since v1.12.0 this package is gone.

I'm using it to create Geo indexes

```go
// Index to location 2dsphere type.
pointIndexModel := mongo.IndexModel{
Options: mopts.Index(),
Keys: bsonx.MDoc{
"location": bsonx.String("2dsphere"),
},
}
 
```
 
What do I replace it with?

Comment by Bernardo Silva [ 28/Jun/23 ]

We have an in-house toolkit for mongoDB using Protobuf for defining schemas. This toolkit relies heavily on bsonx for encoding/decoding values to/from protobuf. As this has been a removal only, we're not sure how to proceed... We could fork bsonx to a different repository maybe?

Comment by Matt Dale [ 28/Jun/23 ]

bernardo.heynemann@coinbase.com the packages in the x/ directory of the Go driver module are documented as experimental and subject to breaking changes.

Can you provide more detail about how you're using the bsonx package so we can understand the impact more and possibly provide a migration strategy?

Comment by Bernardo Silva [ 26/Jun/23 ]

Shouldn't this have been made a major? This broke our applications here at Coinbase. We are now stuck in a previous release and it's unexpected as a minor shouldn't include removal of an entire package, right?

Also, could you create a bsonx library that can be used when transitioning? I get that it won't be part of the core driver, but at least an add-on library? As it is now the effort is non-trivial to migrate to latest mongodb driver.

Help?  

Comment by Githook User [ 16/Nov/22 ]

Author:

{'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}

Message: GODRIVER-2416 Completely remove the 'x/bsonx' package. (#1122)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/63d46a39702580e6d293056e56c6a8f44d89b3b4

Comment by Matt Dale [ 06/Nov/22 ]

The current GridFS spec test runner heavily relies on the API of the bsonx.Doc type. It's much easier to use the newer unified-format GridFS spec tests and modify the unified spec test runner to support all GridFS functions than to convert the existing GridFS spec test runner to use the bson.D or bson.Raw APIs. Most of the existing document/file manipulation logic in the GridFS spec test runner is only necessary because the old GridFS spec tests use pre-V2 Extended JSON syntax, which the Go Driver doesn't support.

Generated at Thu Feb 08 08:38:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.