Skip to content

Releases: mongodb/mongo-go-driver

MongoDB Go Driver 1.8.0

23 Nov 21:53
Compare
Choose a tag to compare

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:

MongoDB Go Driver 1.7.5

23 Nov 16:41
Compare
Choose a tag to compare

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

This release removes an internal code generation tool and its associated dependencies.

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.

Release Notes

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

MongoDB Go Driver 1.7.4

03 Nov 15:38
Compare
Choose a tag to compare

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

This release contains several bugfixes.

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.

Release Notes

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

MongoDB Go Driver 1.7.3

05 Oct 17:46
Compare
Choose a tag to compare

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

This release contains several bugfixes.

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.

Release Notes

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

MongoDB Go Driver 1.7.2

02 Sep 18:55
v1.7.2
ae7e036
Compare
Choose a tag to compare

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

This release contains various bug fixes, including:

  • Fix for a data race that can occur between creating and checking out connections when minPoolSize > 0.
  • Filter servers based on localThresholdMS when opening a new ChangeStream.

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.

Release Notes

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

MongoDB Go Driver 1.6.2

02 Sep 18:50
v1.6.2
4475739
Compare
Choose a tag to compare

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

This release contains a bug fix for a data race that can occur between creating and checking out connections when minPoolSize > 0.

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.

Release Notes

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

MongoDB Go Driver 1.7.1

03 Aug 19:57
Compare
Choose a tag to compare

⚠️ Retracted

This release has been retracted due to a data race that can occur between creating and checking out connections when minPoolSize > 0.

Please use version 1.7.2 or higher.


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

This release contains a bug fix and a minor documentation update:

  • A fix for a data race in appending connection options to the server config
  • A clarification in documentation of StartSession behavior

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.

Release Notes

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

MongoDB Go Driver 1.6.1

03 Aug 19:54
Compare
Choose a tag to compare

⚠️ Retracted

This release has been retracted due to a data race that can occur between creating and checking out connections when minPoolSize > 0.

Please use version 1.6.2 or higher.


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

This release contains a bug fix for a data race in appending connection options to the server config.

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.

Release Notes

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

MongoDB Go Driver 1.7.0

20 Jul 22:22
v1.7.0
d98d92b
Compare
Choose a tag to compare

⚠️ Retracted

This release has been retracted due to a data race that can occur between creating and checking out connections when minPoolSize > 0.

Please use version 1.7.2 or higher.


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

This release supports additional features introduced in MongoDB version 5.0.

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.

Snapshot Reads Without Transaction

Supports using the "snapshot" read concern outside of transactions for certain operations.

Example of using a Session with "snapshot" read concern outside of a transaction for a Find operation:

var client *mongo.Client

// Create a new Session with "snapshot" reads enabled, then create a
// SessionContext with the new Session.
sess, err := client.StartSession(options.Session().SetSnapshot(true))
if err != nil {
	panic(err)
}
defer sess.EndSession(context.TODO())
sessCtx := mongo.NewSessionContext(context.TODO(), sess)

coll := client.Database("db").Collection("coll")
cursor, err := coll.Find(sessCtx, bson.D{{"x", 1}})
defer cursor.Close(context.TODO())

// Use the cursor to read Find results with "snapshot" read concern.

Detailed Document Validation Errors

Surface the improved error messages for schema validation in MongoDB 5.0 in WriteException and BulkWriteException error messages and via the new field WriteError.Details.

Release Notes

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

MongoDB Go Driver 1.6.0

13 Jul 16:30
Compare
Choose a tag to compare

⚠️ Retracted

This release has been retracted due to a data race that can occur between creating and checking out connections when minPoolSize > 0.

Please use version 1.6.2 or higher.


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

This release supports several new features introduced in MongoDB server version 5.0.

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.

Versioned API

This release adds versioned API: a new feature in MongoDB 5.0 that allows user-selectable API versions, subsets of MongoDB server semantics, to be declared on a Client with ServerAPIOptions. See an explanatory blog post here.

ServerAPIOptions can be declared on a Client in the Go driver with SetServerAPIOptions. Within a ServerAPIOptions instance, ServerAPIVersion specifies the declared API version, Strict specifies whether the server should error when it receives a command that is not part of the declared API version, and DeprecationErrors specifies whether the server should error when it receives a command that is deprecated in the declared API version.

Load Balancer Support

The Go driver now supports connecting to any MongoDB service (such as MongoDB Serverless) that is running behind a load balancer.

ClientOptions contains a new LoadBalanced flag that can be set with SetLoadBalanced or by passing loadBalanced=true into the initial URI string.

Time-series Collections

This release allows the creation of time-series collections: a new collection type that will automatically organize time-series data into buckets on insert, while automatically unwinding the buckets for query purposes.

CreateCollectionOptions contains a new TimeSeriesOptions field that can be set with SetTimeSeries. The fields of TimeSeriesOptions are defined as follows. TimeField specifies the name of the top-level field that will represent the timestamp in the collection's documents. MetaField can specify the name of the top-level field that will describe the series in the collection's documents. Granularity can specify the desired granularity of the time-series data (at present, this value can be "seconds", "minutes" or "hours").

CreateCollectionsOptions also contains a new ExpireAfterSeconds field that can be set with SetExpireAfterSeconds. ExpireAfterSeconds can specify how many seconds to wait before old time-series data should be deleted from the time-series collection.

Let Option on Aggregate

Let can now be specified on aggregates. See an explanation and examples of the let option in the aggregate documentation.

AggregateOptions contains a new Let field that can be set with SetLet.

Release Notes

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