Releases: mongodb/mongo-java-driver
Java Driver 5.8.0 (May 28, 2026)
What's Changed
🔥 Enhancements
- Added typed builder API for vector search index definitions #1960 by @rozza
- Added
$rerankaggregation stage support (MongoDB 8.3 / Atlas) #1963 by @rozza - Added
vectorSearchoperator support for the$searchpipeline stage #1962 by @rozza - Added
storedSourcesupport for vector search indexes andreturnStoredSourcefor$vectorSearchqueries #1977 by @rozza - Added
BinaryVectorandVectorSearchQueryvectorSearchoverloads to the Scala driver #1986 by @rozza - Optimized
RawBsonDocumentencode and decode by eliminating intermediate allocations #1988 by @rozza - Preliminary refactoring for backpressure support #1952 by @stIncMale
- Small improvements related to value-based classes #1964 by @stIncMale
🛠 Fixes
- Fixed OSGi bundle resolution failure when Micrometer is not present #1982 by @rozza
- Added missing Javadoc to
MongodbObservationandMongodbObservationContextby @rozza
📦 Dependency Updates
- Upgraded
libmongocryptto 1.18.1 #1983 by @strogiyotec
🧪 Testing & CI
- Added
AGENTS.mdfor AI coding agent support across all modules by @rozza - Added test cases for new auto-embedding index fields #1936 by @strogiyotec
- Added Scala 3 to
publish.sh#1958 by @rozza - Fixed
NamespaceExiststest failure #1956 by @nhachicha - Simplified
RetryStatecreation as preliminary backpressure work #1961 by @stIncMale - Made
RetryState.isLastAttemptprivate and simplified code #1967 by @stIncMale
New Contributors
- @techbelle made their first contribution in #1972
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/current/security/validate-signatures/ for the full procedure.
To download and import the public key for verifying signatures, execute
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 1a75005e142192223d6a7c3b76e0008d166740a8
Full Changelog: r5.7.0...r5.8.0
Java Driver 5.7.0 (April 30, 2026)
Important
A future minor release will raise the minimum supported MongoDB Server version from 4.2 to 4.4. This is in accordance with MongoDB Software Lifecycle Schedules. Support for MongoDB Server 4.2 will be dropped in a future release!
What's Changed
- Added Scala 3 support by @rozza in #1904
- Do various small timeout-related improvements by @stIncMale in #1908
- Add
TODO-JAVA-6126to inform readers that the problem is known by @stIncMale in #1910 - Fix ServerMonitor thread name JAVA-6135 by @raipc in #1861
- Revert "Temp disable large encryption tests on mongocryptd (#1872)" by @rozza in #1914
- build(deps): bump testing/resources/specifications from
bb9ddddto0535e65by @dependabot[bot] in #1915 - Remove unused OperationContextBinding test wrappers by @vbabanin in #1903
- Add Javadoc to specify that CSOT does not limit socket writes by @vbabanin in #1791
- Update Junit 5 to latest by @rozza in #1909
- JAVA-6144 increase wait time for thread pool shutdown by @strogiyotec in #1920
- JAVA-6145 fix encryption test case by @strogiyotec in #1923
- JAVA-6148 increase timeout in RetryableWritesProseTest by @strogiyotec in #1927
- Use ZstdInputStreamNoFinalizer for Zstd decompression by @rozza in #1924
- Release connection between empty getMore responses in AsyncCommandCursor by @vbabanin in #1925
- build(deps): bump testing/resources/specifications from
0535e65toc3c82b6by @dependabot[bot] in #1930 - Fix
com.mongodb.client.FailPoint.enableby @stIncMale in #1931 - Add stack-safe async loop support with trampoline pattern by @vbabanin in #1905
- JsonBsonEncoder: fix parsing of JsonPrimitive numbers by @berlix in #1937
- build(deps): bump testing/resources/specifications from
c3c82b6to7039e69by @dependabot[bot] in #1945 - JAVA-6171 upgrade libcrypt to 1.17.3 by @strogiyotec in #1947
- Fix Kotlin bson decoding of optionals by @rozza in #1941
- [JAVA-6159] Micrometer feedback by @nhachicha in #1940
- [JAVA-6186] Micrometer tests expect the network transport to be tcp by @nhachicha in #1955
- Skip QE prefixPreview and suffixPreview tests on server 9.0.0+ by @rozza in #1954
New Contributors
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/current/security/validate-signatures/ for the full procedure.
To download and import the public key for verifying signatures, execute
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 1a75005e142192223d6a7c3b76e0008d166740a8
Full Changelog: r5.7.0-beta1...r5.7.0
Java Driver 5.6.5 (April 09, 2026)
What's Changed
🛠 Fixes
- AsyncCommandCursor.getMoreLoop() held a pool connection across empty getMore responses on tailable cursors, exhausting the connection pool when idle change streams reached maxPoolSize and causing MongoTimeoutException for all other operations. The retry loop has been moved out of getMoreLoop() and into next().
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.4/security/validate-signatures/ for the full procedure.
To download and import the public key for verifying signatures, execute
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 1a75005e142192223d6a7c3b76e0008d166740a8
Full Changelog: r5.6.4...r5.6.5
Java Driver 5.7.0-beta1 (February 26, 2026)
What's Changed
🔥 Enhancements
-
Add Micrometer/OpenTelemetry tracing support to the reactive-streams
(Micrometer / OpenTelemetry) #1898 -
Improved client-side timeout handling to better account for RTT variations #1793
🛠 Fixes
-
Fixed RawBsonDocument encoding performance regression by restoring optimized codec path #1888
-
Fixed Netty ByteBuf reference counting and reverted read-only change that could cause leaks during logging #1891
📦 Dependency Updates
🧪 Testing & CI
-
Updated BSON/spec tests and improved Extended JSON alignment #1883
-
Added SARIF reporting and CI improvements #1869
-
Temporarily disabled large encryption tests on mongocryptd for CI stability #1872
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.4/security/validate-signatures/ for the full procedure.
To download and import the public key for verifying signatures, execute
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 1a75005e142192223d6a7c3b76e0008d166740a8
Full Changelog: r5.7.0-beta0...r5.7.0-beta1
Java Driver 5.6.4 (February 23, 2026)
What's Changed
- Fixed a recent change in how we use Netty buffers that could cause memory to be released too early under certain allocator configurations, leading to unexpected runtime errors. This update restores the correct shared reference-count behavior in Netty (by @vbabanin in #1897 JAVA-6107)
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.4/security/validate-signatures/ for the full procedure.
To download and import the public key for verifying signatures, execute
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 1a75005e142192223d6a7c3b76e0008d166740a8
Full Changelog: r5.6.3...r5.6.4
Java Driver 5.6.3 (February 03, 2026)
What's Changed
- Revert NettyByteBuf.asReadOnly change (#1871) by @rozza in #1878
Note: Command Logging with Netty will be fixed in 5.7.0
Full Changelog: r5.6.2...r5.6.3
Java Driver 5.7.0-beta0 (January 16, 2026)
What’s Changed 🚀
New Features
- Add auto-embedding support as part of vector search APIs #1862
Credential Handling
- Handle unexpected end-of-stream errors from KMS #1849
- Encryption client now uses writeConcern majority #1858
Performance Optimizations
- Reuse ConnectionSource to avoid extra server selection #1813
Resource Management
- Implement NettyByteBuf.asReadOnly and improve buffer duplication #1841
Compatibility and Maintenance
- Update DEFAULT_ALLOWED_HOSTS to include *.mongo.com #1843
- Update specifications submodule to latest (tests temporarily disabled) #1851
- Remove unused JsonPoweredCrudTestHelper #1838
Benchmarks and Testing
- Add new prose test coverage for transactions #1824
- Improve GridFSObservableSpec cleanup when unsubscribing #1834
- Support optional nModified field in bulk write responses #1823
Bug Fixes and Stability
- Fix server selection flaky tests and update thresholds #1847
- Fix flaky test related to API version handling (JAVA-6016) #1845
- Remove assertion for verbose result due to SERVER-113344 #1835
- Align log level to warning when removing server from cluster #1853
Documentation and Quality of Life
- Update reactive streams MongoCollection JavaDoc to return empty Publisher instead of null #1840
Infrastructure Improvements
- Evergreen git clone depth set to 1 for faster builds #1851
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/current/security/validate-signatures/#std-label-java-validate-signatures for the full procedure.
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 1a75005e142192223d6a7c3b76e0008d166740a8Full Changelog: r5.4.0-alpha0...r5.7.0-beta0
Java Driver 5.6.2 (December 08, 2025)
Java Driver 5.6.1 (October 06, 2025)
Full Changelog: r5.6.0...r5.6.1
Java Driver 5.5.2 (October 06, 2025)
What's Changed
- Merge changes from tls-channel to prevent accidentally calling SSLEng… by @vbabanin in #1737
- Added nexus-publish plugin by @rozza in #1751
Full Changelog: r5.5.1...r5.5.2