Skip to content

Releases: mongodb/mongo-go-driver

MongoDB Go Driver 1.4.0-beta1

10 Apr 19:06
Compare
Choose a tag to compare
Pre-release

The MongoDB Go driver team is pleased to release 1.4.0-beta1 of the official Go driver.

This release contains support for some MongoDB server version 4.4 features and improvements to the driver API.

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.

Context for BSON Errors

In previous versions, unmarshalling BSON bytes into a struct could fail with errors like cannot decode string into int32 type. These errors lacked context and could be confusing to debug. This release adds context to these errors to provide both the BSON key and the struct field name which caused the error. A similar error is now in the form error decoding key foo(fieldFoo): cannot decode string into int32 type.

Release Notes

New Feature

  • [GODRIVER-952] - Lack of context in error description like "cannot decode 64-bit integer into a string type"
  • [GODRIVER-1390] - Support shorter SCRAM conversation
  • [GODRIVER-1542] - Implement primitive.DateTime.UnmarshalJSON

Task

Improvement

  • [GODRIVER-672] - Remove bsonx dependency in driver/session
  • [GODRIVER-1398] - Improve testing around default writeConcern
  • [GODRIVER-1437] - Expand use of error labels for RetryableWrites
  • [GODRIVER-1444] - Change uri_options/auth-options spec test to enable conditional tests
  • [GODRIVER-1445] - Verify max set version and max election id on topologies in SDAM spec tests
  • [GODRIVER-1464] - Make ExceededTimeLimit retryable writes error
  • [GODRIVER-1470] - Raise error if hint specified for unacknowledged update using OP_MSG or OP_UPDATE
  • [GODRIVER-1483] - Add error labels to WriteExceptions
  • [GODRIVER-1499] - Remove timeout check from server selection fast path
  • [GODRIVER-1508] - Allow hinting the delete command
  • [GODRIVER-1509] - Use whitelist for change stream resumability
  • [GODRIVER-1524] - Unreachable code and confusing error message in loadCert
  • [GODRIVER-1526] - Support speculative authentication attempts in isMaster
  • [GODRIVER-1528] - RetryableWrites specification improvements
  • [GODRIVER-1536] - Ensure that the WriteConcernError "errInfo" object is propagated
  • [GODRIVER-1543] - Remove ElectionInProgress (216) from ResumableChangeStreamError
  • [GODRIVER-1546] - Expose gridfs files and chunks collections
  • [GODRIVER-1548] - Access filename and metadata in gridfs DownloadStream
  • [GODRIVER-1551] - Allow BSON undefined to decode to Go types

MongoDB Go Driver 1.3.2

07 Apr 17:36
Compare
Choose a tag to compare

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

This release includes several bugfixes. One of the tickets in this release, https://jira.mongodb.org/browse/GODRIVER-1540, addresses a regression introduced in v1.3.0 which caused a deadlock if a connection encountered a network error during establishment. We recommend any users on v1.3.0 or v1.3.1 update to this version.

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

Bug

  • [GODRIVER-1502] - Extended JSON parsing mishandles invalid $code
  • [GODRIVER-1504] - Unmarshaling attempts to parse top-level keys as extended JSON
  • [GODRIVER-1506] - Extended JSON parsing doesn't restrict $timestamp fields to uint32
  • [GODRIVER-1513] - Extended JSON parsing allow escaping invalid characters
  • [GODRIVER-1520] - Extended JSON lone $scope does not error
  • [GODRIVER-1522] - Read preference should not be sent to mongos for aggregations with output stages
  • [GODRIVER-1532] - Allow invalid UTF-8 strings to be decoded
  • [GODRIVER-1535] - endSessions batching must reset BSON array index
  • [GODRIVER-1540] - library stuck in connection.wait()
  • [GODRIVER-1549] - Handle empty tag sets in read preference

Task

  • [GODRIVER-1431] - Update FLE documentation for community version demonstrating explicit encryption/decryption

MongoDB Go Driver 1.3.1

03 Mar 18:44
Compare
Choose a tag to compare

The MongoDB Go driver team is pleased to release v1.3.1 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

Bug

  • [GODRIVER-895] - bsonrw.valueReader does not verify length of string before slice for CodeWithScope
  • [GODRIVER-1487] - UnknownTransactionCommitResult should be added for more writeConcernErrors
  • [GODRIVER-1488] - Decode struct infinite recursion with mgocompat Registry
  • [GODRIVER-1507] - SRV polling not performed if the URI is not passed to the topology

MongoDB Go Driver 1.3.0

05 Feb 16:43
Compare
Choose a tag to compare

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

This release contains new functions to construct BSON registries, a new BSON registry that mimics the behavior of the globalsign/mgo/bson library, and new URI options to specify TLS certificates and keys as separate files. As part of this release, support for Go modules has been added and the README has been changed to reflect this. There is still a vendor directory in the source code so projects can be compiled with versions of Go that do not support modules.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

mgo compatible BSON

A new mgocompat package has been added under the top-level bson package. This package exports Registry, which is a BSON registry compatible with globalsign/mgo/bson and RegistryRespectNilValues, which is compatible with globalsign/mgo/bson with the RespectNilValues flag set to true. These registries can be used via the ClientOptions.SetRegistry method. The package also exports a RegistryBuilder for each of the registries so additional changes can be made. See the bson/bsoncodec package documentation for more information.

RegistryBuilder method changes

The existing RegisterEncoder methods has been deprecated and replaced by RegisterTypeEncoder and RegisterHookEncoder. A corresponding change has been made for RegisterDecoder as well.

Release Notes

Bug

  • [GODRIVER-1002] - Credential.PasswordSet doesn't work or is incorrectly documented
  • [GODRIVER-1411] - Data race between creating a new connection and disconnecting topology
  • [GODRIVER-1466] - Overriding the type map entry for embedded document does not work
  • [GODRIVER-1476] - mongodb+srv doesn't work with a fully qualified DNS name
  • [GODRIVER-1478] - Pooled sessions should have use time updated when retrieved from the pool

New Feature

  • [GODRIVER-580] - Need to be able to unmarshall to bson.D field within a struct
  • [GODRIVER-917] - Difference in BSON/JSON serialization of nil primitive.D compared to mgo
  • [GODRIVER-1175] - allow BSON null values to decode into non-nilable Go types
  • [GODRIVER-1354] - Create ObjectIDCodec that accepts bsontype.String for decoding
  • [GODRIVER-1356] - Support mgo's Getter and Setter interfaces
  • [GODRIVER-1358] - Add UIntCodec for mgocompat
  • [GODRIVER-1361] - Create mgocompat.Registry
  • [GODRIVER-1362] - Add SliceCodec for mgocompat

Task

  • [GODRIVER-904] - Improve docs for how to write custom codecs
  • [GODRIVER-938] - cannot convert types that use mgobson.ObjectId to new bson library.
  • [GODRIVER-1381] - GridFS GoDoc examples
  • [GODRIVER-1427] - Add more sessions tests with more read and write commands
  • [GODRIVER-1448] - Read operations options documentation

Improvement

  • [GODRIVER-543] - Enable support for Go 1.11 modules
  • [GODRIVER-1421] - Add EmptyInterfaceCodec for mgocompat
  • [GODRIVER-1429] - add ByteArrayCodec for mgocompat
  • [GODRIVER-1430] - allow strings and binaries to decode to symbols
  • [GODRIVER-1433] - Add RespectNilValues equivalent for the mgo registry
  • [GODRIVER-1435] - Please add tlsCertificateFile and tlsKeyFile connection string options.
  • [GODRIVER-1438] - Separate RegisterEncoder/Decoder functions to "types" and "hooks"
  • [GODRIVER-1455] - Use a pure go implementation for zstd
  • [GODRIVER-1460] - Document mgocompat
  • [GODRIVER-1461] - Validate that mongocryptd is not spawned if bypassAutoEncryption=true

MongoDB Go Driver 1.2.1

08 Jan 14:57
Compare
Choose a tag to compare

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

This release contains several bug fixes.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

Release Notes

Bug

  • [GODRIVER-1428] - operation.CreateIndexes doesn't support WriteConcern
  • [GODRIVER-1439] - Only close heartbeat connections after they're opened
  • [GODRIVER-1442] - Fix connection error handling in ProcessError
  • [GODRIVER-1450] - BulkWriteError's request is not the correct one
  • [GODRIVER-1456] - Extended JSON writer should escape keys

MongoDB Go Driver 1.1.4

17 Dec 19:17
Compare
Choose a tag to compare

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

This release contains a bug fix for error checking in the driver's monitoring routine. Prior to this fix, the driver would try to close a monitoring connection if the underlying net.Conn was non-nil. This caused issues for some users with custom dialers due to the nil-interface behavior in Go (see https://golang.org/doc/faq#nil_error). This fix makes it so the driver does not call any methods on connections returned by dialers if the error returned is non-nil.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

Release Notes

Bug

  • [GODRIVER-1439] - Only close heartbeat connections after they're opened

MongoDB Go Driver 1.2.0

10 Dec 18:55
b414b89
Compare
Choose a tag to compare

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

This release contains GA support for client-side field level encryption, a new bson.MarshalValue function to marshal Go values to BSON, and various documentation improvements to add more details and examples to GoDoc.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

Release Notes

Bug

Epic

New Feature

Story

Task

Read more

MongoDB Go Driver 1.1.3

05 Nov 18:42
Compare
Choose a tag to compare

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

This release contains several bug fixes.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

Release Notes

Bug

  • [GODRIVER-1345] - Cancel in-progress heartbeats when disconnecting
  • [GODRIVER-1351] - nil panic on conn close for change stream aggregation operation

Improvement

  • [GODRIVER-1364] - Allow authentication to all server types except arbiters

MongoDB Go Driver 1.1.2

07 Oct 16:02
Compare
Choose a tag to compare

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

This release contains several bug fixes.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

Release Notes

Bug

Mongo Go Driver 1.1.1

05 Sep 18:10
Compare
Choose a tag to compare

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

This release contains several bug fixes.

Documentation can be found on GoDoc and the MongoDB documentation site. BSON library documentation is also available on GoDoc. Questions and inquiries can be asked on the mongo-go-driver Google Group. Bugs can be reported in the Go Driver Jira where a list of current issues can be found.

Release Notes

Backport

Bug