The MongoDB Go Driver Team is pleased to release version 2.7.0 of the official MongoDB Go Driver.
Release Highlights
This release adds support for sending afterClusterTime on writes in causally consistent sessions, improving alignment between read and write behavior in session-based workflows. It also continues cleanup of session-related and internal-only APIs by deprecating the experimental session API, helping clarify which surfaces are intended for long-term public use. Alongside that, the release includes a handful of targeted quality improvements across BSON validation, change streams, and error reporting to make the driver more predictable and easier to debug.
What's Changed
✨ New Features
- GODRIVER-3921 retro backpressure cleanup by @prestonvasquez in #2394
- GODRIVER-3912 Add prose test for database.ListCollection routing by @prestonvasquez in #2390
- GODRIVER-3874 Send afterClusterTime on writes in causally-consistent sessions by @matthewdale in #2412
- GODRIVER-3957 Fix long lines in bson/decoder_example_test.go and expand check-fmt to cover both *_example_test.go and *_examples_test.go files by @linborland in #2428
- GODRIVER-3962 fix: change stream set batch size nil cursor by @zigzagdev in #2424
- GODRIVER-3965 fix: misleading error message type info in rewrap function by @zigzagdev in #2430
🐛 Fixed
- GODRIVER-3862: Collection.Clone propegates BSONOptions by @softprops in #2364
- GODRIVER-3858 Split write batches by wire-message size, not document payload (Merge up from release/2.6). by @qingyang-hu in #2397
- GODRIVER-3931 Fix bson.Raw.Validate panic on zero-length BSON document by @linborland in #2418
- GODRIVER-3832: Fix mongo.ErrorCodes() with ClientBulkWriteException by @FGasper in #2420
- GODRIVER-3960 fix: format Arguments swapping by @zigzagdev in #2423
📝 Other Changes
- GODRIVER-3838 Update comments on SetLimit(). by @qingyang-hu in #2372
- GODRIVER-3871 Make files in "examples" runnable. by @qingyang-hu in #2381
- GODRIVER-3880 Skip QE "prefixPreview" and "suffixPreview" tests on server 9.0.0+. by @qingyang-hu in #2378
- GODRIVER-3917 Replace curl | sh with go install in etc/golangci-lint.sh by @prestonvasquez in #2391
- GODRIVER-3829 Cleanup skip list. by @qingyang-hu in #2392
- GODRIVER-3884 Use gpg verification for libmongocrypt windows build variant by @prestonvasquez in #2404
- GODRIVER-3868 Update extended bson cases. by @qingyang-hu in #2400
- GODRIVER-3623 Deprecate AggregateOptions Custom functionality as internal-only. by @linborland in #2411
- Move the 2125 skips to standalone container by @prestonvasquez in #2421
- GODRIVER-3904 Add QE string prefix/suffix/substring case and diacritic insensitive prose tests by @prestonvasquez in #2415
- GODRIVER-3937 Deprecate x/mongo/driver/session package. by @matthewdale in #2416
- GODRIVER-3936 Migrate check_fmt.sh to a Go script under internal/cmd/check-fmt by @linborland in #2414
- GODRIVER-3726 Use unmarshaling for AutoEncryptOpts in the unified spec test by @linborland in #2413
- Make capitalization of MongoDB Go Driver consistent in the README. by @matthewdale in #2422
- GODRIVER-3113 Skip flaky test in commit.json. by @qingyang-hu in #2435
- GODRIVER-3559 Skip Docker Runner Tests by @qingyang-hu in #2432
New Contributors
- @softprops made their first contribution in #2364
- @linborland made their first contribution in #2411
- @zigzagdev made their first contribution in #2423
Full Changelog: v2.6.2...v2.7.0
For a full list of tickets included in this release, please see the list of fixed issues.
Documentation for the Go Driver can be found on pkg.go.dev and the MongoDB documentation site. BSON library documentation is also available on pkg.go.dev. For issues with, questions about, or feedback for the Go Driver, please look into our support channels, including StackOverflow. Bugs can be reported in the Go Driver project in the MongoDB JIRA where a list of current issues can be found. Your feedback on the Go Driver is greatly appreciated!