Releases: mongodb/mongo-go-driver
MongoDB Go Driver 1.6.0
⚠️ 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:
MongoDB Go Driver 1.5.4
The MongoDB Go driver team is pleased to release version 1.5.4 of the official Go driver.
This release contains several bug fixes, including:
- Prevent clearing server connection pools on operation-scoped timeouts.
- Always enable SRV polling when setting a
mongodb+srv://URI viaApplyURI().
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.5.3
The MongoDB Go driver team is pleased to release 1.5.3 of the official Go driver.
This release contains several bug fixes.
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.5.2
The MongoDB Go driver team is pleased to release 1.5.2 of the official Go driver.
This release contains several bug fixes.
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.5.1
The MongoDB Go driver team is pleased to release 1.5.1 of the official Go driver.
This release contains several bug fixes. Due to the issue below, we recommend all users upgrade to this version of the driver.
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.
CVE-2021-20329
This CVE describes a security issue with the driver's BSON marshalling system. BSON marshalling functions would incorrectly handle null bytes embedded in BSON key names and the pattern/options fields of a BSON regex value. BSON marshalling functions now correctly validate and error if there is an embedded null byte in BSON key names or the pattern/options fields of a BSON regex value. We recommend all users of the driver upgrade to this version.
CVE ID: CVE-2021-20329
Title: Specific cstrings input may not be properly validated in the MongoDB Go Driver
Description: Specific cstrings input may not be properly validated in the MongoDB Go Driver when marshalling Go objects into BSON. A malicious user could use a Go object with specific string to potentially inject additional fields into marshalled documents. This issue affects all MongoDB GO Drivers up to (and including) 1.5.0.
CVSS score: 6.8
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
Affected products and versions, MongoDB Go Driver versions <= 1.5.0
Underlying operating systems affected: All
Release Notes
For a full list of tickets included in this release, please see the links below:
MongoDB Go Driver 1.5.0
The MongoDB Go driver team is pleased to release 1.5.0 of the official Go driver.
This release contains several new features and usability improvements for the driver.
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.
API Improvements
This release contains a new errors API for the primary mongo package. Users can now detect duplicate key errors, timeouts, and network errors via the mongo.IsDuplicateKeyError, mongo.IsTimeout, and mongo.IsNetworkError functions, respectively. Additionally, a new UpdateByID function has been added to the mongo.Collection type to update a single document with a given _id value.
Client-Side Field Level Encryption Improvements
The Go Driver now supports using GCP and Azure key management services with the client-side field level encryption feature. In addition, AWS key management support has been enhanced to allow authenticating with temporary AWS credentials. See the MongoDB docs for more information about these improvements. Use of client-side field level encryption requires users to install the latest released version of libmongocrypt. Note: This means that existing applications that use this feature will need to upgrade the libmongocrypt dependency when upgrading to this driver version; otherwise, the application will fail to compile. Users can upgrade to the latest development release of libmongocrypt via the OS-specific instructions for macos, Windows, and Linux.
Server Monitoring
Monitoring has now been added for various server events. A ServerMonitor set on a mongo.Client monitors changes on the MongoDB deployment it is connected to and reports the changes in the client's representation of the deployment.
Erroring for Maps as Ordered Arguments
The driver will now error if a map with more than one key is used as a hint option, sort option, or for index creation. This is to prevent unexpected behavior, for example, an index being created with the keys in the wrong order.
Release Notes
For a full list of tickets included in this release, please see the links below:
Projects:
MongoDB Go Driver 1.4.7
The MongoDB Go driver team is pleased to release 1.4.7 of the official Go driver.
This release contains several bug fixes and internal testing improvements. Most notably, GODRIVER-1879 is fixed in this release. This ticket ensures that the connectTimeoutMS URI option, which defaults to 30 seconds, applies to both the creation of a socket and the TLS handshake, if applicable.
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:
Projects:
MongoDB Go Driver 1.4.6
The MongoDB Go driver team is pleased to release version 1.4.6 of the official Go driver.
This release contains several bug fixes.
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.4.5
The MongoDB Go driver team is pleased to release 1.4.5 of the official Go driver.
This release contains several bug fixes.
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.5.0-beta1
The MongoDB Go driver team is pleased to release 1.5.0-beta1 of the official Go driver.
This release contains driver-specific improvements.
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.
Azure/GCP Support for Client Side Field Level Encryption
This release includes beta support for using Azure and GCP key management with the client-side field level encryption feature. See the MongoDB docs for more information and code samples. Use of client-side field level encryption, even without Azure/GCP, requires users to install the latest development release of libmongocrypt. Note: This means that existing applications that use this feature will need to upgrade the libmongocrypt dependency when upgrading to this driver release; otherwise, the application will fail to build. Users can upgrade to the latest development release of libmongocrypt via the OS-specific instructions for macos, Windows, and Linux. Each OS-specific link contains instructions for installing both the latest stable and dev releases.
Server Monitoring
Monitoring has now been added for various server events. A ServerMonitor set on a client monitors changes on the MongoDB deployment it is connected to, and reports the changes in the client's representation of the deployment.ServerError
The ServerError interface wraps errors returned from the server, specifically CommandError, WriteException, and BulkWriteException, to make them easier to handle programmatically.Improved BSON performance
Improved unmarshalling performance when unmarshalling to interface{}. There are no application changes required to take advantage of these improements.Release Notes
For a full list of tickets included in this release, please see the links below: