Releases: mongodb/mongo-java-driver
Java Driver 5.6.0 (September 11, 2025)
What's Changed 🚀
Credential Handling
- Fix OIDC reauthentication when a session is involved #1719
- Add X509 authentication tests #1771
- Fix OIDC tests #1753
- Add CSOT to OIDC #1741
Performance Optimizations
- Clear CommandCursorResult.results after next()/tryNext() #1780
- Ignore maxWaitTime when CSOT is enabled #1744
- Simplify Operations by uniting Sync and Async operations #1776
Resource Management
- Fix Netty reference leak #1762
- Properly handle exceptions in threads created by MongoClient #1764
- Propagate timeout errors to callback #1761
- Merge changes from tls-channel to prevent accidentally calling SSLEngine #1726
Compatibility and Maintenance
- Handle dropIndex behavior change #1785
- Remove Legacy based ClientSideEncryptionTests #1799
- Remove code that won't execute on supported server releases #1704
- Simplify tests based on 4.2 minimum server support #1712
- Update libmongocrypt version to 1.14.1 #1778
- Deprecate MongoNamespace#COMMAND_COLLECTION_NAME #1786
- Remove internal use of MongoNamespace.COMMAND_COLLECTION_NAME #1782
Benchmarks and Testing
- Support text indexes with encryption #1797
- Ensure encrypted fields data exists fully #1802
- CSFLE auto encryption tests improvements #1788
- Normalize async and sync ClientSideOperationTimeoutProseTest #1800
- Add prose test to verify server monitors do not gossip cluster time #1766
- Added logging specification tests #1740
- Include submodules to OIDC testing #1703
Bug Fixes and Stability
- Fix duplicate field name serialization with @BsonDiscriminator and getter #1610
- Fix Scala UnifiedTest import (No PR link)
- Temporarily limit TypeMqlValuesFunctionalTest.asString server version #1803
- Fix parameterized test names in CrudProseTest #1775
- Improve MongoTimeoutException thrown by DefaultConnectionPool #1767
- Improve error message clarity in MongoCommandException #1789
- Ensure socks5 proxy option parsing is to specification #1688
Documentation and Quality of Life
- Update README.md #1716
- Add JavaDoc to NamespaceType #1754
- Include error messages for stale primary #1714
- Added operation (aka command name) to structured logging #1758
Kotlin Improvements
- JAVA-3815: Pojo Codec - Detect property models on extended interfaces #563
- Ensure custom KProperty include the name in the hashcode #1710
Test Enhancements
- Add support for awaiting CommandStartedEvent in Unified Test Runner #1790
- Update specifications and skip optional rawData based tests #1772
- Improve test clarity and execution time #1743
- Fix datalake and k8s test failures #1720
- Improve Netty test variants #1721
Infrastructure Improvements
- Automate closing and releasing maven artifacts when publishing #1757
- Auto close the repository on publish #1755
- Update waiting times for the transition stage #1756
- Update the evergreen build to use the AWS secrets manager (No PR link)
- Evergreen added shell script to create a git archive #1718
- Add CODEOWNERS file #1739
- Github action fix echo'd file name #1804
All Other Changes
- Add Client Metadata Update Support #1708
- Add namespace type support to ChangeStreamDocument #1736
- Simplify RequestMessage class hierarchy #1787
- Remove unused OperationTypeCodec #1746
- Use OperationContext with NOOP Session #1733
- Publish ClusterDescriptionChangedEvent on topology close #1738
- Ensure serverHeartbeatEvent is sent before opening a connection #1715
- Update the DEFAULT_CODEC_REGISTRY order #1795
- Add parameter type in reflect-config.json for ChangeStreamDocument #1759
- Added ClientEncryption methods to scala #1779
- Modify a redundant code for CAPIHelper #1653
- sunset Astrolabe #1769
- Multiple build dependency updates #1801, #1794, #1783, #1773, #1763, #1748, #1735, #1724, #1713, #1711, #1698
- Various version bumps and snapshot updates (Multiple commits without PR links)
- Various CI/CD and infrastructure adjustments (Multiple commits without PR links)
New Contributors
New Contributors
- @abalanonline made their first contribution in #1764
- @zzypersonally made their first contribution in #1653
- @raffaeleflorio made their first contribution in #1610
- @rishitb-mongodb made their first contribution in #1716
Full Changelog: r5.5.1...r5.6.0
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
Java Driver 5.5.1 (June 06, 2025)
What's Changed
- Fixed an issue where OIDC reauthentication failed when sessions were involved (#1725).
- Ensured custom
KProperty
implementations correctly include property names in their hashcode calculations (#1731). - Resolved failures in datalake and Kubernetes integration tests (#1732).
- Updated to use
OperationContext
with a NOOP session for improved consistency (#1734).
Full Changelog: r5.5.0...r5.5.1
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.5/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
Java Driver 5.5.0 (May 07, 2025)
What's Changed
🚀 New Features and Improvements
-
Credential Handling:
- Added option to configure Data Encryption Key (DEK) cache lifetime (#1689).
-
Performance Optimizations:
- Enhanced BSON codec lookup (#1632).
- Optimized BSON decoding (#1667).
- Reduced temporary buffer allocations during BSON serialization (#1628).
- Optimized numeric value writing (#1635).
- Improved String write and length computations (#1651, #1685).
- Enhanced buffer handling to avoid direct list access (#1675).
- Replaced
Stack
withArrayDeque
for better performance (#1681).
-
Resource Management:
-
Compatibility and Maintenance:
-
Benchmarks and Testing:
-
Bug Fixes and Stability:
-
Documentation and Quality of Life:
-
Kotlin Improvements:
🧪 Test Enhancements
- Added IPv6 literal testing in SDAM (#1648).
- Introduced additional regression and CRUD operation tests (#1692, #1687).
- Improved testing strategy for flaky unified tests (#1565).
🛠️ Infrastructure Improvements
- Modernized Gradle build processes and ensured Maven artifacts are properly signed (#1654, #1709).
- Improved performance test configuration and resource allocation (#1676).
Other Changes
- Split atlas-deployed-task-group across multiple hosts (#1640)
- Fix driver-lambda evg failure (#1643)
- Test Load balancers (#1649)
- Adjust maxAwaitTimeMS by remaining timeout. (#1650)
- Deprecate read preference hedge options (#1655)
- Fix
scalac
warning (#1666) - Record both FaaS and container metadata when both are present (#1661)
- Add String cache for BsonArray indexes. (#1664)
- Optimize BsonArray Index encoding (#1673)
- Fix ByteBufferBsonOutput buffer caching logic. (#1683)
- Fix the cold
Publisher
link in the API documentation (#1678) - Ignore collectionUUID field if present in change stream tests (#1684)
- Updated the bom validation to ensure it runs. (#1671)
- Specifications. (#1690)
- Reenable clientside-operations-timeout apply maxAwaitTimeMS if less than remaining timeout test (#1693)
- Update ClientEncryptionCustomEndpointTest (#1694)
- Skip test for latest (#1700)
- Added extra test to ignore for reactive streams (#1699)
- Add non compliance skip for Atlas Data Lake getMore test (#1701)
- Enable test of nsType with a collection view (#1702)
- Fix static check warnings. (#1696)
- Add missing Javadoc. (#1697)
- DEVPROD-16438 - migrate perf.send to cedar_report endpoint (#1679)
- Fix validation in release.yml (#1706)
👏 New Contributors
Welcome and thank you to our new contributors:
We appreciate all contributions to the MongoDB Java Driver—thank you!
Full Changelog:(r5.4.0-alpha0...r5.5.0)
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
Java Driver 5.4.0 (March 20, 2025)
What's Changed
🚀 New Features & Enhancements
- JAVA-5767 Support $lookup in CSFLE and QE #1638
- Improved selection criteria for
srvMaxHosts
. #1590 - Add index hint support for distinct command #1581
Atlas Search Improvements
- Added multiple new Atlas Search operators:
phrase
,regex
,queryString
,wildcard
,moreLikeThis
,equals
, andin
. #1586, #1587, #1588, #1596, #1609, #1606, #1605
Bulk Write and Update Enhancements
- Improved Bulk Write API and added sort option support to
updateOne
andreplaceOne
. #1509, #1585, #1612 - Added Scala Client Bulk Write API. #1603
Driver and Codec Optimizations
- Optimized BSON codec lookup. #1632
- Optimized ObjectID sorting and serialization/deserialization. #1582
Client and Connection Handling
- Updated cursors to refresh
timeoutMS
onclose
without affecting operation timeout. #1527 - Added
AsyncTransportSettings
andExecutorService
. #1489 - Ensured connections are not closed prematurely when
timeoutMS
expires before sending requests. #1573 - Removed explicit fairness from
DefaultConnectionPool
. #1575
Cloud and Security Improvements
Kotlin Updates
- Merging feature branch (Kotlin extensions) into main #1572
- JAVA-5776 Make KProperty.path() public #1617
- JAVA-5736 Add bsonNamingStrategy option to support snake_case #1627
🛠 Maintenance and Improvements
- Renamed
Vector
class names and markedPackedBitVector
as Beta. #1595, #1594 - Improved handling and initialization of
CAPI
andjna.Native
. #1553 - Updated Gradle scripts and build configurations. #1620, #1624, #1607, #1569
- Replaced JetBrains annotations with MongoDB annotations. #1644
- Stop using the
kotlinCheck
Gradle task fromssdlc-report.sh
#1574
Testing and CI Improvements
- Clarified and cleaned up internal testing APIs (
TestDef
). #1566, #1578 - Enhanced unified test skipping and handling logic. #1557, #1551, #1584
- Added integration tests for Atlas Search and Load Balancers. #1616, #1649
- Improved test cleanup and retry logic to reduce flakiness. #1608, #1565
Specification Syncing and Updates
- Synced BSON and server selection specification tests. #1555, #1554
- Synced
non-lb-connection-establishment
. #1634
🐞 Bug & Test Fixes
- Stop ignoring id parameter #1622
- Fixed static checker warnings and deprecation warnings. #1564, #1613, #1633
- Resolved unintended sync test skipping. #1600
- Fixed module naming for Kotlin extensions. #1602
- Fixed integration test issues for Regex and Wildcard operators. #1611
- Update
pool-checkout-returned-connection-maxConnecting.json
to work with different pool implementations #1563 - Add flaky annotation to flaky tests #1558
- Remove deprecated field from GridFS unified tests #1577
- Fix driver-lambda evg failure #1643
- Test IPv6 literal in SDAM #1648
- Split atlas-deployed-task-group across multiple hosts #1640
- Change branch name to main in SSDLC script. #1552
- Add
@SuppressWarnings("try")
toCommandBatchCursorTest
,AsyncCommandBatchCursorTest
#1567 - JAVA-5781 Add env var override #1623
- Evergreen: Update to use stop-orchestration.sh #1621
🌟 Community Contributions
New Contributors:
We appreciate all contributions to the MongoDB Java Driver—thank you!
Full Changelog: r5.3.1...r5.4.0
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.3/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
Java Driver 5.4.0-alpha0 (February 27, 2025)
What's Changed
- Make
CAPI
,jna.Native
/Structure
initializable at run time by @stIncMale in #1553 - Clean up unified tests via skipping API by @katcharov in #1551
- Sync BSON specification tests by @jyemin in #1555
- Sync server selection specification tests by @jyemin in #1554
- Update
pool-checkout-returned-connection-maxConnecting.json
to work with different pool implementations by @stIncMale in #1563 - Fix static checker warnings in
AggregatesSpecification.groovy
by @stIncMale in #1564 - Change branch name to main in SSDLC script. by @vbabanin in #1552
- Add flaky annotation to flaky tests by @katcharov in #1558
- Move most skips to single file, expand API to handle conditions by @katcharov in #1557
- Update cursors to refresh
timeoutMS
onclose
without affecting the timeout of the operation by @stIncMale in #1527 - Add AsyncTransportSettings, ExecutorService by @katcharov in #1489
- Add
@SuppressWarnings("try")
toCommandBatchCursorTest
,AsyncCommandBatchCursorTest
by @stIncMale in #1567 - Clean up TestDef API, clarify naming by @katcharov in #1566
- Merging feature branch (Kotlin extensions) into main by @nhachicha in #1572
- Stop using the
kotlinCheck
Gradle task fromssdlc-report.sh
by @stIncMale in #1574 - Remove explicit fairness from
DefaultConnectionPool
by @stIncMale in #1575 - Make sure
TestDef
is created and used only when there is enough data to do that by @stIncMale in #1578 - Connections must not be closed when timeoutMS expires before sending a request by @stIncMale in #1573
- Remove deprecated field from GridFS unified tests by @joykim1005 in #1577
- Add index hint support for distinct command by @joykim1005 in #1581
- Provide the reason for the test skips. by @vbabanin in #1584
- Rename Vector class names. by @vbabanin in #1595
- Allow updateOne and replaceOne to supply sort option by @joykim1005 in #1585
- Mark PackedBitVector as Beta, aligning with binary quantization preview by @vbabanin in #1594
- Improved Bulk Write API by @stIncMale in #1509
- Resolve unintended sync test skipping. by @vbabanin in #1600
- Fixing default module name for kotlin-extensions by @nhachicha in #1602
- Add phrase operator for Atlas Search by @joykim1005 in #1586
- Format Gradle script to comply with static checks. by @vbabanin in #1607
- Improve selection criteria for srvMaxHosts by @joykim1005 in #1590
- Add regex operator to Atlas Search by @joykim1005 in #1587
- Add queryString operator to Atlas Search by @joykim1005 in #1588
- Add wildcard operator to Atlas Search by @joykim1005 in #1596
- Fix Int Test for Regex and Wildcard Operator by @joykim1005 in #1611
- Add moreLikeThis operator to Atlas Search by @joykim1005 in #1609
- Fix test cleanup to prevent conflicts between tests. by @vbabanin in #1608
- Add Scala Client Bulk Write API. by @vbabanin in #1603
- Remove deprecation warnings. by @vbabanin in #1613
- Add equals operator to Atlas Search by @joykim1005 in #1606
- Client Bulk Write sort option. by @vbabanin in #1612
- Add in operator to Atlas Search by @joykim1005 in #1605
- Evergreen: Update to use stop-orchestration.sh by @rozza in #1621
- Gradle updated to use version catalogs by @rozza in #1620
- Revert "Gradle updated to use version catalogs" by @rozza in #1624
- Optimize ObjectID sort and serdes by @Edarke in #1582
- Stop ignoring id parameter by @katcharov in #1622
- JAVA-5781 Add env var override by @katcharov in #1623
- JAVA-5771 Add search integration tests by @katcharov in #1616
- Fix warnings by @stIncMale in #1633
- Add BOM generation. by @vbabanin in #1569
- JAVA-5791 Sync
non-lb-connection-establishment
by @kevinAlbs in #1634 - Add OIDC k8s provider by @katcharov in #1576
- JAVA-5767 Support $lookup in CSFLE and QE by @katcharov in #1638
New Contributors
- @joykim1005 made their first contribution in #1577
- @Edarke made their first contribution in #1582
Full Changelog: r5.3.0-beta0...r5.4.0-alpha0
Java Driver 5.3.1 (January 23, 2025)
What's Changed
- Fixing default module name for
kotlin-extensions
(Backport #1602 to 5.3.x by @nhachicha in #1604)
Full Changelog: r5.3.0...r5.3.1
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.3/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
Java Driver 5.3.0 (January 10, 2025)
Important
A future minor release will raise the minimum supported MongoDB Server version from 4.0 to 4.2. This is in accordance with MongoDB Software Lifecycle Schedules. Support for MongoDB Server 4.0 will be dropped in a future release!
What's Changed
- Make
CAPI
,jna.Native
/Structure
initializable at run time by @stIncMale in #1553 - Clean up unified tests via skipping API by @katcharov in #1551
- Sync BSON specification tests by @jyemin in #1555
- Sync server selection specification tests by @jyemin in #1554
- Update
pool-checkout-returned-connection-maxConnecting.json
to work with different pool implementations by @stIncMale in #1563 - Fix static checker warnings in
AggregatesSpecification.groovy
by @stIncMale in #1564 - Change branch name to main in SSDLC script. by @vbabanin in #1552
- Add flaky annotation to flaky tests by @katcharov in #1558
- Move most skips to single file, expand API to handle conditions by @katcharov in #1557
- Update cursors to refresh
timeoutMS
onclose
without affecting the timeout of the operation by @stIncMale in #1527 - Add AsyncTransportSettings, ExecutorService by @katcharov in #1489
- Add
@SuppressWarnings("try")
toCommandBatchCursorTest
,AsyncCommandBatchCursorTest
by @stIncMale in #1567 - Clean up TestDef API, clarify naming by @katcharov in #1566
- Merging feature branch (Kotlin extensions) into main by @nhachicha in #1572
- Stop using the
kotlinCheck
Gradle task fromssdlc-report.sh
by @stIncMale in #1574 - Remove explicit fairness from
DefaultConnectionPool
by @stIncMale in #1575 - Make sure
TestDef
is created and used only when there is enough data to do that by @stIncMale in #1578 - Connections must not be closed when timeoutMS expires before sending a request by @stIncMale in #1573
- Remove deprecated field from GridFS unified tests by @joykim1005 in #1577
- Add index hint support for distinct command by @joykim1005 in #1581
- Provide the reason for the test skips. by @vbabanin in #1584
- Rename Vector class names. by @vbabanin in #1595
- Allow updateOne and replaceOne to supply sort option by @joykim1005 in #1585
- Mark PackedBitVector as Beta, aligning with binary quantization preview by @vbabanin in #1594
- Improved Bulk Write API by @stIncMale in #1509
- Resolve unintended sync test skipping. by @vbabanin in #1600
New Contributors
- @joykim1005 made their first contribution in #1577
Full Changelog: r5.3.0-beta0...r5.3.0
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.3/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
Java Driver 5.2.1 (November 06, 2024)
What's Changed
- Exclude
com.oracle.svm.core.annotate
fromImport-Package
for OSGi by @stIncMale in #1520 - Make CAPI, jna.Native/Structure initializable at run time (#1553) by @stIncMale in #1556
- Ensure
kotlinx.datetime.LocalTime
exists before adding the serializer (Backport #1530 by @katcharov in #1559)
Full Changelog: r5.2.0...r5.2.1
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.2/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
Java Driver 4.11.5 (November 06, 2024)
Java Driver 5.3.0-beta0 (October 31, 2024)
What's Changed
- Sync client-side-encryption legacy specification tests by @jyemin in #1511
- Update branch name from master to main in GH action workflow by @jyemin in #1516
- Exclude
com.oracle.svm.core.annotate
fromImport-Package
for OSGi by @stIncMale in #1518 - Enable tests that require failCommand with appName on initial handshake before 4.9 by @NathanQingyangXu in #1519
- Add BSON binary subtype 8 by @NathanQingyangXu in #1524
- Fix Evergreen config file error by @jyemin in #1523
- Sync valid-pass/valid-fail tests from unified test specification by @jyemin in #1517
- Work around gradle issue and optionally include graalvm project by @rozza in #1522
- Fix pom scope for Scala projects by @rozza in #1531
- Run more tests concurrently in CI by @jyemin in #1514
- Ensure kotlinx.datetime.LocalTime exists before adding the serializer by @rozza in #1530
- Bump Scala patch versions by @rozza in #1535
- Allow valid SRV hostnames with less than 3 parts by @NathanQingyangXu in #1525
- Sync unified server discovery and monitoring tests by @jyemin in #1536
- Sync up load balancer specs by @NathanQingyangXu in #1542
- Sync up command logging specs by @NathanQingyangXu in #1537
- Sync up transaction-convenient-api specs by @NathanQingyangXu in #1544
- Sync up session specs by @NathanQingyangXu in #1547
- Sync up index-management specs by @NathanQingyangXu in #1545
- Sync retryable reads and writes unified tests by @katcharov in #1541
- Add BSON Binary Subtype 9 support for vector storage and retrieval. by @vbabanin in #1528
- Sync up transaction specs by @NathanQingyangXu in #1539
- Sync CRUD unified tests by @nhachicha in #1543
- Sync up command monitoring specs by @NathanQingyangXu in #1538
- Add support for vector search with BSON Vector by @vbabanin in #1549
- Sync up collection-management specs by @NathanQingyangXu in #1546
- Sync unified change-streams tests by @katcharov in #1550
Full Changelog: r5.2.0...r5.3.0-beta0
Verifying artifact signatures
Please refer to https://www.mongodb.com/docs/drivers/java/sync/v5.2/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