Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (52 sloc) 2.57 KB
.. _scala:
.. include:: /includes/unicode-checkmark.rst
====================
MongoDB Scala Driver
====================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: twocols
Introduction
------------
This is the officially supported Scala driver for MongoDB.
It's a modern idiomatic Scala driver with asynchronous and non-blocking IO.
- `Getting Started <http://mongodb.github.io/mongo-scala-driver/2.6/getting-started/>`__
- `Usage Guide <http://mongodb.github.io/mongo-scala-driver/2.6/reference/>`__
- `API Reference <http://mongodb.github.io/mongo-scala-driver/2.6/scaladoc/>`_
- `Changelog <http://mongodb.github.io/mongo-scala-driver/2.6/changelog/>`__
- `Source Code <http://github.com/mongodb/mongo-scala-driver>`__
Installation
------------
The recommended way to get started using the driver in your project is with a dependency management system like ``sbt`` or ``maven``. See `Installation Guide <http://mongodb.github.io/mongo-scala-driver/2.6/getting-started/installation-guide/>`__ for more information.
Connect to MongoDB Atlas
------------------------
To connect to a `MongoDB Atlas <https://docs.atlas.mongodb.com/>`_ cluster, use the `Atlas connection string <https://docs.atlas.mongodb.com/driver-connection>`__ for your cluster:
.. code-block:: scala
import org.mongodb.scala._
// ...
val uri: String = "mongodb+srv://<username>:<password>@<cluster-address>/test?retryWrites=true&w=majority"
System.setProperty("org.mongodb.async.type", "netty")
val client: MongoClient = MongoClient(uri)
val db: MongoDatabase = client.getDatabase("test")
See `Connecting <http://mongodb.github.io/mongo-scala-driver/2.6/reference/connecting/>`__
for more ways to connect.
Compatibility
-------------
MongoDB Compatibility
~~~~~~~~~~~~~~~~~~~~~
.. include:: /includes/extracts/scala-driver-compatibility-matrix-mongodb.rst
.. include:: /includes/mongodb-compatibility-table-scala.rst
.. include:: /includes/older-server-versions-unsupported.rst
Language Compatibility
~~~~~~~~~~~~~~~~~~~~~~
.. include:: /includes/extracts/scala-driver-compatibility-matrix-language.rst
.. include:: /includes/language-compatibility-table-scala.rst
How to get help
---------------
- Join our `Google Group <https://groups.google.com/forum/#!forum/mongodb-user>`__.
- Ask on `Stack Overflow <https://stackoverflow.com/questions/tagged/mongodb+scala>`__.
- Visit our `Support Channels <https://docs.mongodb.com/manual/support/>`__.
- See our `JIRA <https://jira.mongodb.org/browse/SCALA>`__ to raise issues or request features.
You can’t perform that action at this time.