github mongodb/mongo-go-driver v1.8.0
MongoDB Go Driver 1.8.0

latest releases: v2.0.0-beta2, v1.17.0, v1.17.0-beta1...
2 years ago

The MongoDB Go driver team is pleased to release version 1.8.0 of the official Go driver.

This release supports additional features introduced in MongoDB version 5.1 and includes a refactor to our connection-pooling logic.

Documentation can be found on pkg.go.dev and the MongoDB documentation site. BSON library documentation is also available on pkg.go.dev. Questions and inquiries can be asked on the MongoDB Developer Community. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

CSFLE 1.0 KMIP Support

Supports using KMIP as a KMS provider for client side encryption.

Example of registering a client with auto-encryption through a KMIP KMS server with TLS.

// Provide KMS providers map with KMIP endpoint.
kmipKmsProviderMap := map[string]map[string]interface{}{
        "kmip": {
	        "endpoint": "IP.of.KMIP.Server",
        },
}

// Create TLS config with tlsCertificateKeyFile and tlsCAFile.
tlsConfig := make(map[string]*tls.Config)
tlsOpts := map[string]interface{}{
        "tlsCertificateKeyFile": "path/to/tls/certfile",
        "tlsCAFile":             "path/to/tls/cafile",
}

// Build config and handle error.
kmipConfig, err := options.BuildTLSConfig(tlsOpts)
if err != nil {
        panic(err)
}
tlsConfig["kmip"] = kmipConfig

// Create new client with auto-encryption options.
aeo := options.AutoEncryption().
        SetKmsProviders(kmipKmsProviderMap).
        SetKeyVaultNamespace("keyvault.datakeys").
        SetTLSConfig(tlsConfig)
opts := options.Client().ApplyURI("mongodb://localhost:27017").SetAutoEncryptionOptions(aeo)
client, err := mongo.NewClient(opts)
if err != nil {
        panic(err)
}

Oppressive Language Removal

Following the guidance documented here, we removed all oppressive and unnecessarily gendered language in the Go driver documentation, code, tests, and spec tests.

Connection Pool Redesign

The driver connection pool has been redesigned to work better when using low (< 30s) operation Context timeouts and reduce connection churn.

Behavior changes:

  • New connection creation is timed out at connectTimeoutMS. Previously, new connection creation was done synchronously with an operation and was timed out with the minimum of the operation Context timeout and connectTimeoutMS.
  • At most 2 connections are established at the same time. Previously, the max number of new connections established at the same time was maxPoolSize.

Release Notes

For a full list of tickets included in this release, please see the links below:

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

NewReleases is sending notifications on new releases.