github mongodb/mongo-go-driver v2.9.0
MongoDB Go Driver 2.9.0

2 hours ago

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

🐛 Fixed

📦 Dependency Updates

📝 Other Changes

New Contributors

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!

Don't miss a new mongo-go-driver release

NewReleases is sending notifications on new releases.