MyGit

v1.8.0

mongodb/mongo-go-driver

版本发布时间: 2021-11-24 05:53:56

mongodb/mongo-go-driver最新发布版本:v1.16.1(2024-08-08 03:39:35)

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:

Release Notes

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

相关地址:原始地址 下载(tar) 下载(zip)

查看:2021-11-24发行的版本