Download and Install
1
2
Create a project directory
Run the following command in your shell to create a directory
called scala-quickstart
for this project:
mkdir scala-quickstart
Select the tab corresponding to your operating system and run the following commands
to create a build.sbt
file in the scala-quickstart
directory:
cd scala-quickstart touch build.sbt
cd scala-quickstart type nul > build.sbt
3
Configure your project to use the Scala driver
Navigate to your build.sbt
file and add the following code to use
the Scala driver in your application:
ThisBuild / scalaVersion := "2.13.16" libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "5.3.0"
This code configures your application to use Scala version 2.13.16 and Scala driver version 5.3.0.
After you complete these steps, you have a new project directory with the driver dependencies installed.
Note
If you run into issues on this step, ask for help in the MongoDB Community Forums or submit feedback by using the Rate this page tab on the right or bottom right side of this page.