Fix This Page
Navigation

MongoDB Scala Drivers

This is an overview of the available tools for using Scala with MongoDB. Those wishing to skip to more detailed discussion should check out the Mongo Scala Driver Tutorial.

Mongo Scala Driver

The Mongo Scala Driver is the officially supported Scala driver for MongoDB. It’s a modern idiomatic Scala driver with asynchronous and non-blocking IO.

Compatibility

MongoDB Compatibility

The following compatibility table specifies the recommended version(s) of the Mongo Scala driver for use with a specific version of MongoDB.

The first column lists the driver version(s).

Scala Driver MongoDB 2.4 MongoDB 2.6 MongoDB 3.0 MongoDB 3.2 MongoDB 3.4
2.1
2.0
1.2
1.1  
1.0    

For additional driver versions, see Mongo Scala Driver Compatibility Reference.

The driver does not support older versions of MongoDB.

Language Compatibility

The following compatibility table specifies the recommended version(s) of the Mongo Scala driver for use with a specific version of Scala.

The first column lists the driver version(s).

Scala Driver Scala 2.11 Scala 2.12
2.1
2.0
1.1
1.1  
1.0  

For additional driver versions, see Mongo Scala Driver Language Compatibility Reference.

Casbah

Casbah is the legacy Scala driver for MongoDB. It provides wrappers and extensions to the Java Driver meant to allow a more Scala-friendly interface to MongoDB. It supports serialization/deserialization of common Scala types (including collections and regex), Scala collection versions of DBObject and DBList and a fluid query DSL.

Compatibility

MongoDB Compatibility

The following compatibility table specifies the recommended version(s) of the Casbah for use with a specific version of MongoDB.

The first column lists the driver version(s).

Casbah MongoDB 2.6 MongoDB 3.0 MongoDB 3.2 MongoDB 3.4
3.1
3.0  
2.8  

For additional driver versions, see Casbah Compatibility Reference.

The driver does not support older versions of MongoDB.

Language Compatibility

The following compatibility table specifies the recommended version(s) of the Casbah for use with a specific version of Scala.

The first column lists the driver version(s).

Casbah Scala 2.9.3 Scala 2.10 Scala 2.11 Scala 2.12
3.1  
3.0    
2.8  

For additional driver versions, see Casbah Language Compatibility Reference.

Community

  • Reactive-Mongo a reactive driver that allows you to design very scalable applications unleashing MongoDB capabilities like streaming infinite live collections and files for modern Realtime Web applications.
  • Tepkin a reactive driver built on top of Akka.io and Akka Streams that has a powerful DSL to easily create MongoDB records. It allows you to design very scalable applications by asynchronously inserting and retrieving (infinite) streams of data with non-blocking backpressure directly into respectively out of MongoDB through Akka streams.
  • Rogue: A Type-Safe Scala DSL - Foursquare’s DSL for querying MongoDB alongside Lift-MongoDB-Record. - Tutorial/Intro - Source/Downloads
  • frontlets lightweight typed wrappers around Scala maps, with strong mongo support and JSON integration. Supports type-safe queries in spirit of the original mongo collection interface, object graph traversal, immutable objects among other features.
  • Subset2 MongoDB document parser combinators and builders for use with the Java driver.
  • Hammersmith is a Scala-based, asynchronous Netty driver for MongoDB with type-class based fast custom object encoding.
  • Salat is a simple serialization library for case classes. Leverages MongoDB’s DBObject (which uses BSON underneath) as its target format. Salat is focused on fostering a DWIM and intuitive usage pattern for the end-user’s benefit, without sacrificing run time performance.
  • Blue Eyes is a lightweight framework for building REST APIs with strong MongoDB integration including a DSL and Mock MongoDB for testing.
  • Lift Web Framework supports MongoDB through Lift-MongoDB and object mapping via the Record back-end implementation.
  • Mssd (MongoDB Synchronous Scala Driver) is a synchronous Scala driver which wraps the plain old java driver with a more elegant scala friendly API. Mssd focuses on simplicity of use with not too much magic involved.
  • Mongolia is a type-safe Scala DSL, based on the v2.+ Java driver. It enforces type-safety by implicitly converting non-BSON values to BSON, fully configurable. It also bypasses the Java drivers’ UUID bug by storing UUIDs as type 4 Binary.