Skip to content

Commit 83b64ac

Browse files
authored
Update to MongoDB Go driver 2.4 (#187)
This updates MongoDB’s Go driver to version 2.4, which dropped support for 4.0 but can still work with it via a simple tweak of the globals (per the driver team’s recommendation in GODRIVER-3701).
1 parent 9fdd7b1 commit 83b64ac

File tree

24 files changed

+391
-194
lines changed

24 files changed

+391
-194
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
github.com/urfave/cli v1.22.9
2323

2424
// NB: This is the last driver version that supported 4.0.
25-
go.mongodb.org/mongo-driver/v2 v2.3.1
25+
go.mongodb.org/mongo-driver/v2 v2.4.0
2626
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
2727
golang.org/x/sync v0.18.0
2828
gopkg.in/natefinch/lumberjack.v2 v2.0.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfS
131131
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
132132
go.mongodb.org/mongo-driver/v2 v2.3.1 h1:WrCgSzO7dh1/FrePud9dK5fKNZOE97q5EQimGkos7Wo=
133133
go.mongodb.org/mongo-driver/v2 v2.3.1/go.mod h1:jHeEDJHJq7tm6ZF45Issun9dbogjfnPySb1vXA7EeAI=
134+
go.mongodb.org/mongo-driver/v2 v2.4.0 h1:Oq6BmUAAFTzMeh6AonuDlgZMuAuEiUxoAD1koK5MuFo=
135+
go.mongodb.org/mongo-driver/v2 v2.4.0/go.mod h1:jHeEDJHJq7tm6ZF45Issun9dbogjfnPySb1vXA7EeAI=
134136
golang.org/x/arch v0.16.0 h1:foMtLTdyOmIniqWCHjY6+JxuC54XP1fDwx4N0ASyW+U=
135137
golang.org/x/arch v0.16.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE=
136138
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package verifier
2+
3+
import "go.mongodb.org/mongo-driver/v2/x/mongo/driver/topology"
4+
5+
func init() {
6+
7+
// Version 2.4 of the driver dropped support for server 4.0.
8+
// This is a workaround from GODRIVER-3701 that the maintainers
9+
// indicate will preserve the needed functionality.
10+
topology.MinSupportedMongoDBVersion = "4.0"
11+
topology.SupportedWireVersions.Min = 7 // 4.0
12+
}

vendor/go.mongodb.org/mongo-driver/v2/internal/driverutil/description.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/go.mongodb.org/mongo-driver/v2/mongo/bulk_write.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/go.mongodb.org/mongo-driver/v2/mongo/client.go

Lines changed: 92 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/go.mongodb.org/mongo-driver/v2/mongo/client_bulk_write.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)