Learn about new features, improvements, and fixes introduced in the following versions of the MongoDB Scala Driver:
What's New in 5.11.1
Important
The Scala driver 5.11.1 includes fixes for the following CVEs:
For the latest information about MongoDB security updates, see MongoDB Security Bulletins.
To learn more about this release, see the v5.11.1 Release Notes on GitHub.
What's New in 5.11
The 5.11 driver release does not include any changes, fixes, or features that apply to the Scala driver.
To learn more about this release, see the v5.11 Release Notes on GitHub.
What's New in 5.10
The 5.10 driver release includes the following changes, fixes, and features:
- Removes the stale
@Betaannotation from theSearchOptionsandVectorSearchOptionsclasses.
Adds the
$scoreFusionaggregation stage, which combines and normalizes the scores of multiple search pipelines. This stage requires MongoDB 8.2 or later.Adds a fluent builder API for the
$scoreaggregation stage. Use this API to configure score normalization, weighting, and score details. This feature requires MongoDB 8.2 or later.Adds the
parentFilterandnestedOptionsoptions, which allow nested embeddings and arrays of embeddings in$vectorSearchqueries.
To learn more about this release, see the v5.10 Release Notes on GitHub.
What's New in 5.9.2
The 5.9.2 driver patch release includes the following changes:
- Fixes an issue where
ProxySettings.toString()included the SOCKS5 proxy username and password, which caused these credentials to appear in application logs. This issue affects driver versions 4.11.0 through 5.9.1. To learn more, see JAVA-6266 and CVE-2026-18710.
Warning
Suppress the Log Message Without Upgrading
If you use SOCKS5 proxy authentication and can't upgrade to v5.9.2, set the org.mongodb.driver.client logger to WARN or higher to suppress the client-construction message. We don't recommend this as a long-term measure, because it silences diagnostic information that is valuable for support and it doesn't remove credentials that are already written to existing logs.
To learn more about this release, see the v5.9.2 Release Notes on GitHub.
What's New in 5.9
The 5.9 driver release includes the following changes, fixes, and features:
Promotes Queryable Encryption (QE) prefix, suffix, and substring queries to general availability (GA). These query types are supported on MongoDB 9.0 and later. To learn more about QE, see In-Use Encryption.
Renames the explicit encryption API for QE string queries from
TexttoString. To perform a QE string query, make the following changes:Use the
StringOptionsclass instead ofTextOptions.Use the
EncryptOptions.stringOptions()method instead oftextOptions().Use the
EncryptOptions.getStringOptions()method instead ofgetTextOptions().Set the encryption algorithm to
"String".
Upgrades the
libmongocryptversion to 1.20.0.
To learn more about this release, see the v5.9 Release Notes on GitHub.
What's New in 5.8
The 5.8 driver release includes the following changes, fixes, and features:
- Adds
BinaryVectorandVectorSearchQueryoverloads to thevectorSearch()method.
Adds a typed builder API for vector search index definitions.
Adds support for the
$rerankaggregation stage. When connected to an Atlas cluster running MongoDB 8.3 or later, you can use theAggregates.rerank()builder method to create this stage.Adds support for the
vectorSearchoperator in a$searchpipeline stage. You can use theSearchOperator.vectorSearch()builder method to perform approximate nearest neighbor (ANN) vector search, orSearchOperator.vectorSearchExact()for exact nearest neighbor (ENN) search. The returnedVectorSearchOperatorsupports afilter()method to apply lexical prefilters.Adds support for configuring stored source on vector search index definitions by using the
storedSource()method in theVectorSearchIndexDefinitionclass.Adds support for requesting stored source fields in
$vectorSearchresults by using thereturnStoredSource()method in theVectorSearchOptionsclass.Optimizes
RawBsonDocumentencode and decode performance by eliminating intermediate allocations.Fixes an OSGi bundle resolution failure when Micrometer is not present.
Adds Javadoc documentation to the
MongodbObservationandMongodbObservationContextclasses.Upgrades the
libmongocryptversion to 1.18.1.
To learn more about this release, see the v5.8 Release Notes on GitHub.
What's New in 5.7.1
The 5.7.1 driver patch release includes the following changes:
- Fixes an issue where the Scala 3 artifact was not published in version 5.7.0.
Fixes Javadoc warnings in the Micrometer integration.
Marks Micrometer OSGi imports as optional to resolve bundle resolution issues in OSGi runtime environments.
To learn more about this release, see the v5.7.1 Release Notes on GitHub.
What's New in 5.7
Important
Scala 3 Support
Scala driver v5.7 introduces support for Scala 3. The Scala 3 artifact is available beginning in v5.7.1. You can use the Scala driver with Scala 2.11, 2.12, 2.13, or 3.x. To learn more about compatible Scala versions, see the Compatibility page.
The 5.7 driver release includes the following changes, fixes, and features:
- Adds support for Scala 3. The driver now publishes artifacts for Scala 3 in addition to existing Scala 2.11, 2.12, and 2.13 artifacts. You can use the driver with any supported Scala version by using the
%%operator in yourbuild.sbtfile, which automatically selects the correct artifact for your Scala version.
Important: An upcoming minor release will drop support for MongoDB Server version 4.2 and raise the minimum supported version to 4.4. This change aligns with the MongoDB Software Lifecycle Schedules.
We recommend making changes to your application to accommodate breaking changes. To learn more about upgrading your server version, see the Release Notes section in the MongoDB Server manual.
Adds Scala 3 support.
Adds auto-embedding support as part of vector search APIs.
Adds Micrometer/OpenTelemetry tracing support to the reactive-streams driver, and includes general Micrometer support improvements.
Adds stack-safe async loop support with trampoline pattern to prevent stack overflow errors.
Improves client-side timeout handling to better account for round-trip time (RTT) variations, along with various small timeout-related improvements.
Reuses
ConnectionSourceto avoid extra server selection.Restores the optimized codec path for
RawBsonDocumentencoding, fixing a performance regression.Releases the connection between empty
getMoreresponses inAsyncCommandCursor, preventing connection pool exhaustion when idle change streams reachmaxPoolSize.The encryption client now uses
writeConcernmajority.Handles unexpected end-of-stream errors from KMS.
Fixes
JsonBsonEncoderparsing ofJsonPrimitivenumbers, where scientifically formatted numbers were parsed as plain Ints or Longs.Simplifies
ServerMonitorthread names and removes the=character, which some monitoring systems cannot process.Fixes Kotlin BSON decoding of optionals.
Upgrades
libmongocryptto 1.17.3.Uses
ZstdInputStreamNoFinalizerfor Zstandard decompression.Updates Netty to the latest version.
Updates Snappy for the latest security fixes.
Updates JUnit 5 to the latest version.
Aligns the log level to warning when removing a server from the cluster.
What's New in 5.6
The 5.6 driver release includes the following changes, fixes, and features:
What's New in 5.5.1
The 5.5.1 driver patch release includes the following changes:
- Fixes an issue where OIDC reauthentication failed when triggered by an operation run in a session, including operations run in a transaction.
What's New in 5.5
Important
Removal of Support for MongoDB Server 4.0
Scala driver v5.5 removes support for MongoDB Server 4.0. To learn more about compatible versions of the server, see Compatibility.
The 5.5 driver release includes the following changes, fixes, and features:
- Adds support for the
connectTimeoutMSoption when using the default TLS transport layer.
- Introduces performance improvements that are reflected in the driver performance benchmarks. To view the results of the performance benchmark tests, see the following Performance Improvements section.
Performance Improvements
The tables in this section show the results of performance tests for the synchronous Java driver. The tests were conducted on a MongoDB Server 8.0 deployment with the following configuration:
Running on
localhostwith negligible network latency. In higher-latency environments, you might see less significant performance improvements.Authentication disabled.
TLS disabled.
We expect similar performance increases for all MongoDB Java drivers because they share the improved driver-core API.
Standard Transport Settings
The following table shows the results of performance tests for v5.5 of the driver configured with standard transport settings. Each row includes the feature tested, the percent improvement in performance, and the z-score.
Feature | Percent Improvement | Z-score |
|---|---|---|
Deep BSON decoding | 19.44% | 5.4 |
Deep BSON encoding | 102% | 22.8 |
Find many and empty the cursor | 25.08% | 13.72 |
Find one by ID | 2.7% | 3.16 |
Flat BSON decoding | 31.2% | 9.38 |
Flat BSON encoding | 199.5% | 12.34 |
Full BSON decoding | 16.5% | 7.23 |
Full BSON encoding | 147.3% | 10.39 |
JSON-LD multi-file import | 21.8% | 8.21 |
Client bulk insert with large documents | 91.3% | 24.44 |
Collection bulk insert with large documents | 96.5% | 8.79 |
Bulk insert with large documents | 93.3% | 8.11 |
Bulk insert with small documents | 39.3% | 5.72 |
Insert one with large documents | 82.4% | 7.28 |
Client bulk insert with small documents | 49.5% | 17.99 |
Collection bulk insert with small documents | 47.8% | 6.44 |
Netty Transport Settings
The following table shows the results of performance tests for v5.5 of the driver configured with Netty transport settings. Each row includes the feature tested, the percent improvement in performance, and the z-score.
Feature | Percent Improvement | Z-score |
|---|---|---|
Find many and empty the cursor | 40.3% | 14.81 |
Find one by ID | 4.4% | 4.12 |
JSON-LD multi-file import | 16.9% | 3.77 |
Client bulk insert with large documents | 54.8% | 14.49 |
Collection bulk insert with large documents | 104.9% | 38.72 |
Bulk insert with large documents | 74.6% | 65.55 |
Insert one with large documents | 66.6% | 58.65 |
Client bulk insert with small documents | 36.1% | 15.41 |
Collection bulk insert with small documents | 39.3% | 37.38 |
Bulk insert with small documents | 35.1% | 41.51 |
Tip
To learn more about how we conduct driver performance benchmark tests, see the Performance Benchmarking specification.
What's New in 5.4
The 5.4 driver release includes the following changes, fixes, and features:
- Implements a client bulk write API that allows you to perform write operations on multiple databases and collections in the same call. To learn more about this feature, see the Client Bulk Write section of the Bulk Write Operations guide.
Supports
$lookupoperations for CSFLE and QE. To learn more, see the following references in the Server manual:$lookup and $graphLookup Behavior for CSFLE
Introduces a Bill of Materials (BOM) to manage versions of MongoDB JVM artifacts that you might use in your application. To view instructions on adding the BOM to your application, see the mongodb-driver-bom dependency listing on the Maven Repository website. You can use the BOM only if you are using Maven as your dependency manager, as sbt does not support BOMs.
Updates AWS SDK dependencies to 2.30.31 and 1.12.782 for testing the
MONGODB-AWSauthentication mechanism.Adds a sort option to the
ClientUpdateOneOptionsandClientReplaceOneOptionsclasses. This change allows you to set a sort order for update and replace operations in client bulk writes. To learn more, see the Update Operations and Replace Operations sections of the Bulk Write Operations guide.Adds Kubernetes support for OIDC authentication. To learn more, see the MongoCredential API documentation.
Adds first class support for the following MongoDB Search query operators:
phraseregexqueryStringequalsmoreLikeThisinwildcard
To learn more, see the Search Operator Helper Methods section of the Aggregation guide.
Updates cursors to refresh the
timeoutMSsetting when you callclose()without affecting the operation timeout.Enables you to use an index when calling the
distinct()method by specifying ahintoption.
To view a full list of changes in this release, see the v5.4 release notes on GitHub.
What's New in 5.3
The 5.3 driver release includes the following changes, fixes, and features:
Important: The next minor release will drop support for MongoDB Server version 4.0 and raise the minimum supported version to 4.2. We recommend making changes to your application to accommodate breaking changes. See the Release Notes section in the Server manual to learn more about upgrading.
Adds the
BinaryVectorclass to implement BSON Binary Subtype 9 for vector storage and retrieval. This class provides more effective storage of values compared a list ofDoubleinstances. You can create the following vector types based on the type of elements your vector contains:Int8BinaryVector: Vector of 8-bit signed integersFloat32BinaryVector: Vector of floating-point numbersPackedBitBinaryVector: Binary quantized vector (In beta and subject to change before becoming generally available)
To learn more about this feature, see Vector Quantization in the Atlas documentation. To learn about this type, see the BinaryVector API documentation.
Removes explicit fairness from the connection pool implementation. This change might contribute to better throughput when you use a
MongoClientinstance in many application threads. However, this change might cause increased tail latency.Adds a sort option to the
updateOne()andreplaceOne()methods. This change also allows you to set a sort as an option when creatingReplaceOneModelandUpdateOneModelinstances. To learn more, see the Update Documents, Replace Documents, and Bulk Write Operations guides.
What's New in 5.2
Important
Removal of Support for MongoDB Server 3.6
Scala driver v5.2 removes support for MongoDB Server 3.6. To learn more about compatible versions of the server, see Compatibility.
The 5.2 driver release includes the following changes, fixes, and features:
What's New in 5.1.3
The 5.1.3 driver patch release includes the following changes:
What's New in 5.1.1
The 5.1.1 driver patch release includes the following changes:
- When using the
MONGODB-OIDCauthentication mechanism, you must not include comma characters in theauthMechanismPropertiesconnection string value.
What's New in 5.1
Important
MongoDB Server v3.6 End-of-Life
Support for MongoDB Server v3.6 is deprecated in this release and will be removed in the v5.2 release of the driver.
To learn about other changes introduced in v5.1, see the What's New guide in the Java Sync Driver documentation.