Docs Menu
Docs Home
/ / /
Go Driver

What's New

On this page

  • What's New in 1.17
  • What's New in 1.16
  • What's New in 1.15.1
  • What's New in 1.15
  • What's New in 1.14
  • What's New in 1.13
  • What's New in 1.12.1
  • What's New in 1.12

Tip

Release Notes

To learn more about changes and updates between versions, you can read the release notes published with the driver source code.

Learn what's new in:

Important

v1.17 is the final planned 1.x version release. This version will receive security and bug fixes, but future development and features will be included only in 2.x versions of the driver.

The 1.17 Go driver release includes the following improvements and fixes:

  • Adds support for OpenID Connect (OIDC) authentication. To learn more, see the MONGODB-OIDC section of the Enterprise Authentication Mechanisms guide.

  • Adds support for Queryable Encryption (QE) range queries. To use this feature, your app must connect to MongoDB Server 8.0 or later. For more information about QE range queries, see Queryable Encryption in the MongoDB Server manual.

  • Adds support for MongoDB Server 8.0, except for the client bulk write feature.

  • Extends the IndexView type to include the DropOneWithKey() and DropWithKey() methods so you can drop indexes by using their key specifications instead of their names.

For more information about the changes in this version, see the v1.17 release notes on GitHub.

The 1.16 Go driver release includes the following improvements and fixes:

  • Adds support for specifying an index type when creating an Atlas Search index.

  • Reduces memory usage when the zstd compression algorithm is enabled.

  • Upgrades some dependency requirements. For a list of upgrades, see the "Upgrade Dependencies" section of the v1.16 release notes.

For more information about these changes, see the v1.16 release notes on Github.

The 1.15.1 Go driver patch release includes the following improvements and fixes:

  • Fixes a possible connection leak where disconnecting from a replica set cluster left behind rttMonitor connections.

  • Adds support for manually specifying a maxTimeMS value for read and aggregation operations when a client-wide timeout and an operation timeout are set.

  • Adds a RemainingBatchLength() method that you can call on a change stream.

For more information about these changes, see the v1.15.1 release notes on Github.

The 1.15 Go driver release includes the following improvements and fixes:

  • Connection churn can be mitigated by setting a client-wide timeout by specifying the timeoutMS connection option or by calling the SetTimeout() function. When the timeout is set, the driver attempts to reuse a connection after an operation times out and waits for up to one second to check if the connection can be reused before closing it.

  • Connection pool events include a Duration field to measure the checkout duration and total amount of time it took to establish a connection.

The 1.14 Go driver release includes the following improvements and fixes:

  • Go versions before 1.18 are no longer supported.

  • In case of a heartbeat timeout, in-progress operations are preemptively canceled.

  • Connection strings that include the "mongodb+srv://" prefix can contain capital letters in the SRV hostname.

The 1.13 Go driver release includes the following improvements and fixes:

  • Logging for server selection and SDAM. To learn more about logging, see the Logging documentation.

  • Methods on the Collection type that allow you to manage search indexes programmatically.

  • The event.CommandStartedEvent and event.CommandFinishedEvent events return the DatabaseName field. This field is also included in the command-logging analogs.

  • In a sharded topology, when selecting a server to retry an unsuccessful query, the driver excludes the server used for the initial attempt. Instead, if there's more than one eligible mongos instance, the driver randomly selects one. Unhealthy instances are automatically excluded from selection.

  • Streaming SDAM is disabled by default on AWS Lambda and similar function-as-a-service (FaaS) platforms. You can enable monitoring by using the serverMonitoringMode URI option.

The 1.12 Go driver release includes the following improvements and fixes:

  • The driver unpins connections when ending a session. This prevents connections from leaking when a user runs a transaction while connected to a load balancer.

  • The driver does not throw a runtime error when you unmarshal an empty bson.RawValue type with an invalid type or marshal a nil pointer of a ReadConcern instance.

  • Setting options.LogComponentAll as the log component correctly results in the publication of logs against all components.

Important

Deprecation Notice

  • The mongo.NewClient() and client.Connect() methods are deprecated. You can create a client and connect in one call by using the mongo.Connect() method.

New features of the 1.12 Go driver release include:

This driver version adds support for Queryable Encryption (QE). To learn more about the requirements for using the QE feature, see the Queryable Encryption Driver Compatibility Table.

The ClientEncryption.CreateEncryptedCollection() method automatically creates data encryption keys when you create a new encrypted collection. To learn how to use the QE feature, see the Quick Start in the Server manual.

You can now record connection management and command execution events by using the LogSink logging interface.

To learn more, see the Logging Fundamentals guide.

This driver version adds features to the options package to specify how the driver marshals and unmarshals BSON.

The following example shows how to set BSON options on your Client. The options specify the following behaviors:

  • The driver falls back to json struct tags if bson struct tags are absent.

  • The driver marshals nil Go map types as empty BSON documents.

  • The driver marshals nil Go slice types as empty BSON arrays.

bsonOpts := &options.BSONOptions{
UseJSONStructTags: true,
NilMapAsEmpty: true,
NilSliceAsEmpty: true,
}
options.Client().SetBSONOptions(bsonOpts)

For a full example of how to specify and implement the BSONOptions type, see the API documentation.

This driver version simplifies the WriteConcern API. To learn more about the changes, see Write Concern.

  • Support for authentication with AWS IAM roles in EKS.

  • Addition of the Cursor.SetBatchSize() method to allow specification of the size of batches fetched when iterating through a cursor.

  • Addition of the UnmarshalValue() method to allow ummarshalling of BSON values marshalled with the MarshalValue() method.

Back

Quick Reference