The MongoDB Go Driver Team is pleased to release version 2.9.0 of the official MongoDB Go Driver.
Release Highlights
Warning
The minimum supported MongoDB server version is now 4.4.
Warning
The minimum supported Go version is now 1.25. The Go Driver supports the last 2 Go minor versions.
New ext/awsauth module
The new ext/awsauth module adds support for all AWS authentication methods via the official AWS SDK for Go. Applications running on AWS can now use an awsauth.CredentialsProvider in ClientOptions, ClientEncryptionOptions, and AutoEncryptionOptions.
For example, to configure a mongo.Client with the new ext/awsauth module:
import (
"context"
"log"
"github.com/aws/aws-sdk-go-v2/config"
"go.mongodb.org/mongo-driver/ext/awsauth"
"go.mongodb.org/mongo-driver/v2/mongo"
"go.mongodb.org/mongo-driver/v2/mongo/options"
)
func main() {
cfg, err := config.LoadDefaultConfig(context.Background())
if err != nil {
log.Fatal(err)
}
provider := awsauth.NewCredentialsProvider(cfg.Credentials)
credential := options.Credential{
AuthMechanism: "MONGODB-AWS",
AWSCredentialsProvider: provider,
}
client, err := mongo.Connect(options.Client().SetAuth(credential))
if err != nil {
log.Fatal(err)
}
defer client.Disconnect(context.Background())
// ...
}Note
ext/awsauth is currently released as an experimental module and may have breaking changes in the future.
MongoDB 9.0 Intelligent Workload Management (IWM) Improvements
Improved performance for MongoDB 9.0's Intelligent Workload Management (IWM) by only retrying overload errors when doing so is expected to not worsen server conditions.
What's Changed
✨ New Features
- GODRIVER-4034 Update the built-in AWS credential interfaces to match aws-sdk-go-v2. by @qingyang-hu in #2481
- GODRIVER-3567 Add optional AWS SDK v2-based MONGODB-AWS authenticator submodule by @qingyang-hu in #2494
- GODRIVER-3856: Bump maxWireVersion for 9.0 server release by @prestonvasquez in #2520
- GODRIVER-3567 Add optional AWS SDK v2-based MONGODB-AWS authenticator submodule by @qingyang-hu in #2508
- GODRIVER-3872: Mark Server version 4.2 as EOL by @prestonvasquez in #2523
- GODRIVER-3963 Update client backpressure with baseBackoffMS. by @qingyang-hu in #2544
- GODRIVER-3956 Fix TLS record header error tests on Windows by @qingyang-hu in #2558
- GODRIVER-4013: Remove the goreportcard badge from README.md by @ayesha-ilm in #2574
- GODRIVER-4060: Remove unused authenticator field from endSessionsOp by @zigzagdev in #2565
- GODRIVER-4101 Add
tlsDisableCertificateRevocationCheckoption. by @qingyang-hu in #2571
🐛 Fixed
- GODRIVER-4102: reject int32 length overflow in bsoncore valueLength by @rajath201 in #2548
- GODRIVER-4108: Exclude remote TLS alerts from backpressure labels by @prestonvasquez in #2570
- GODRIVER-4096 Fix panic in Collection.insert on out-of-order write errors by @harmv in #2557
- GODRIVER-4109: Exclude OCSP errors from backpressure label by @prestonvasquez in #2584
📦 Dependency Updates
- Bump github.com/klauspost/compress from 1.17.6 to 1.19.0 by @dependabot[bot] in #2464
- GODRIVER-4044 Update golang.org/x/text to v0.39.0 and raise minimum Go version to 1.25. by @qingyang-hu in #2522
- Bump github.com/klauspost/compress from 1.17.6 to 1.19.2 by @dependabot[bot] in #2539
📝 Other Changes
- GODRIVER-4062 Remove the ServerOverloadedError retry example. by @matthewdale in #2568
New Contributors
- @rajath201 made their first contribution in #2548
- @ayesha-ilm made their first contribution in #2574
- @harmv made their first contribution in #2557
Full Changelog: v2.8.2...v2.9.0
For a full list of tickets included in this release, please see the list of fixed issues.
Documentation for the Go Driver can be found on pkg.go.dev and the MongoDB documentation site. BSON library documentation is also available on pkg.go.dev. For issues with, questions about, or feedback for the Go Driver, please look into our support channels, including StackOverflow. Bugs can be reported in the Go Driver project in the MongoDB JIRA where a list of current issues can be found. Your feedback on the Go Driver is greatly appreciated!