Java MongoDB Driver

Java Driver 3.0 Released

For more information, see Introducing the 3.0 Java Driver.

Starting with the 3.0 release, the official MongoDB Java Driver provides both synchronous and asynchronous interaction with MongoDB.

For the official MongoDB Java Driver documentation, see the MongoDB Java Driver Documentation. For the API documentation, see MongoDB Java Driver API Documentation.

Driver Features

MongoDB Driver
An updated Java driver that includes the legacy API as well as a new generic MongoCollection interface that complies with a new cross-driver CRUD specification. For documentation on the Java Driver, including the Getting Started guide, see Java Driver Documentation.
MongoDB Async Driver
A new asynchronous API that can leverage either Netty or Java 7’s AsynchronousSocketChannel for fast and non-blocking IO. For documentation on the Async Java Driver,including the Getting Started guide, see Async Java Driver Documentation.
BSON Library
A standalone BSON library with a new Codec infrastructure that you can use to build high-performance encoders and decoders without requiring an intermediate Map instance. For documentation on the BSON Library, see BSON Library.
Core Driver
A new core library upon which both the MongoDB Driver and Async Driver are both built. Users can use the new core library to build alternative or experimental high-level APIs.


The recommended way to incorporate the driver into your project is with a dependency management system. For more information, see MongoDB Java Driver.

If upgrading from an earlier version of the Java driver, see also What’s New.


supported. compatible. anything incompatible will be fixed: Supported
unsupported. minor incompatibilities may exist: Minor incompatibility
unsupported. incompatible: Unsupported

MongoDB Compatibility

        MongoDB Version
    2.4 2.6 3.0
  2.9 Minor incompatibility Minor incompatibility Minor incompatibility
  2.10 Minor incompatibility Minor incompatibility Minor incompatibility
  2.11 Supported Minor incompatibility Minor incompatibility
  2.12 Supported Supported Minor incompatibility
  2.13 Supported Supported Supported
Driver Version 3.0 Supported Supported Supported

Older server versions are unsupported.

Language Compatibility

          Language Version
    Java 5 Java 6 Java 7 Java 8
  2.7 Supported Supported Supported Supported
  2.8 Supported Supported Supported Supported
  2.9 Supported Supported Supported Supported
  2.10 Supported Supported Supported Supported
  2.11 Supported Supported Supported Supported
  2.12 Supported Supported Supported Supported
  2.13 Supported Supported Supported Supported
Driver Version 3.0 Unsupported Supported Supported Supported

Third Party Frameworks and Libraries

POJO Mappers

  • Morphia. Type-Safe Wrapper with DAO/Datastore abstractions.
  • Spring MongoDB. Provides Spring users with a familiar data access features including rich POJO mapping.
  • Morphium. Feature-rich POJO Mapper including features like declarative caching, cluster awareness, validation, partial updates supports aggregation framework.
  • Mungbean (w/clojure support).
  • DataNucleus JPA/JDO. JPA/JDO wrapper
  • lib-mongomapper. JavaBean Mapper (No annotations).
  • MongoJack. Uses jackson (annotations) to map to/from POJOs and has a simple wrapper around DBCollection to simply this.
  • Kundera. JPA compliant ORM. Works with multiple datastores.
  • MongoFS. Enhanced file storage library with support for file compression, encryption, and Zip file expansion. Can be used on top of a GridFS-compatible bucket.
  • Jongo. Query in Java as in mongo shell (using strings), unmarshall results into Java objects (using Jackson)
  • MongoLink. Object Document Mapper (ODM.) Uses a plain java DSL for mapping declaration.
  • Hibernate OGM. Provides Java Persistence support for MongoDB.
  • Morphix. Lightweight, easy-to-use POJO mapper.

Code Generation

  • Sculptor. MongoDB-based DSL -> Java (code generator)
  • GuicyData. DSL -> Java generator with Guice integration.

JavaScript (Rhino)

  • Horn of Mongo. A MongoDB shell built on the Rhino JavaScript Engine for Java.
  • MongoDB-Rhino. A toolset to provide full integration between the Rhino JavaScript engine for the JVM and MongoDB. Uses the MongoDB Java driver.