What's New
Learn about new features, improvements, and fixes introduced in the following versions of the MongoDB Scala Driver:
What's New in 5.2
New features of the 5.2 driver release include:
Adds the
SearchIndexType
class, which you can pass when constructing aSearchIndexModel
instance. This change allows you to specify the index type when creating an Atlas Search or Vector Search index. To learn more, see the SearchIndexModel API documentation.Delegates the implementation of the algorithms that implement the
SCRAM-SHA-1
andSCRAM-SHA-256
authentication mechanisms to the configured JCA provider. This change means that your application can use a configured FIPS-compliant JCA provider to provide a higher level of security.Revises the mongodb-crypt dependency versioning to match the versioning for the JVM drivers. Future versions of
mongodb-crypt
will be released alongside the driver and will share the same version number. You must upgrade yourmongodb-crypt
dependency to v5.2.0 when upgrading your driver for this release. To learn more, see the In-Use Encryption guide.Performance improvements due to implementation of native cryptography on all supported platforms. The following list describes the actions needed to implement this improvement depending on your operating system:
Windows: Upgrade your
mongodb-crypt
version to v5.2.0.Mac: Upgrade your
mongodb-crypt
version to v5.2.0.Linux: Install
libmongocrypt.so
directly on the file system, instead of using the file that is bundled within themongodb-crypt
JAR file. You can find Linux instructions to installlibmongocrypt
in the Server manual. If you use a package manager to installlibmongocrypt
, Java Native Access (JNA) will find it there without further configuration. Alternatively, you can specify the search path by setting theLD_LIBRARY_PATH
environment variable to the file path of thelibmongocrypt
package.We recommend direct installation because the bundled shared library does not link with OpenSSL due to the potential for OpenSSL binary incompatibilities.
The shared library loading is handled by JNA. You can view the rules for library loading search path order in the NativeLibrary class documentation.
Fixes an issue that caused the
InsertOneResult.getInsertedId()
andInsertManyResult.getInsertedIds()
methods to return incorrect document IDs in some situations. This change is backported to Scala driver v5.1.4 and v4.11.4.When a sharded cluster operation is unsuccessful, the driver avoids selecting the same
mongos
server for operation retry attempts if othermongos
servers are available.Adds reachability metadata needed when your application uses GraalVM Native Image. This metadata replaces the need for collecting reachability metadata when using the driver libraries. To learn more, see Reachability Metadata in the GraalVM documentation.
This change does not add the
libjnidispatch
andlibmongocrypt
resource entries, because adding entries for all supported platforms (targets) significantly affects the size of native executables built using GraalVM Native Image. View this sample resource-config.json file in the driver GitHub repository to see how to specify these entries explicitly if your application depends on theorg.mongodb:mongodb-crypt
library.Enables exact vector search by extending the
VectorSearchOptions
API to introduce the following specific option subtypes:ExactVectorSearchOptions
: Use this options type to enable precise matching, ensuring that results are the closest vectors to a given query vector.ApproximateVectorSearchOptions
: Use this options type to enable searches that might not return the exact closest vectors. You can pass anumCandidates
parameter when instantiating this type to specify the number of nearest neighbors to consider.
To learn more about using the Atlas Vector Search feature, see the Atlas Vector Search Quick Start and select Scala from the language dropdown.
What's New in 5.1.3
The 5.1.3 driver patch release includes the following changes:
Fixes an issue that could cause assertion errors when using
Cursor
types.
What's New in 5.1.1
The 5.1.1 driver patch release includes the following changes:
When using the
MONGODB-OIDC
authentication mechanism, you must not include comma characters in theauthMechanismProperties
connection 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.